Jump to content

One for the developers: variable name length


qwert
 Share

Recommended Posts

Is there a “runtime cost” associated with long variable names?

 

Other than for the size of the au3 file, does it take longer to execute statements that contain long names? If so, can the effect be quantified in any way? For example, what would be the difference between:

 

$i

$index

$index_for_the_current_array

 

I couldn’t find any references to this consideration (or non-consideration, if that turns out to be the case).

 

Thanks in advance.

Link to comment
Share on other sites

  • Moderators

qwert,

It has been shown that longer variable names do add to the runtime of a script - the difference is measurable, although not greatly significant in relation to the overall "slowness" of AutoIt as an interpreted language. When we learnt about this, Jos added to Obfuscator (and retained within Au3Stripper) the possibility to replace the variable and function names with much shorter ones:

 

/RenameMinimum /RM - Generates a much smaller file by substituting function and variable names with unique 2+-character names

So now you can have the best of both worlds - sensible variable names for coding and short ones for running. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thanks for that insight.

the difference is measurable, although not greatly significant

 

I guess my best bet is to take a complex script and measure it both ways.  But it sounds like I won't see much beyond a 1 or 2 percent difference.  It may take me a while to get to this, but I'll post back if I find any real significance ... just for the record.

 

Link to comment
Share on other sites

It's a case of readability vs performance. I know which one I would rather have when creating scripts. As Melba23 there is Au3Stripper, so there is really no excuse to have variable names like $u9, unless that means something to you.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

What led me to think about this is the case of compiled "production" scripts, where, for me, performance trumps readability.  I began to wonder how much I was losing every time I elaborated a variable name to make it more meaningful.

But the /RM option, as Melba23 pointed out, is the obvious answer.  'Til now, I've only run it with /SO.

Thanks for your response.

Link to comment
Share on other sites

I find this test surprising. Or am I doing anything wrong?

 

Example1()
Example2()

Func Example1()
  Local $hTimer = TimerInit()
  Local $ThisIsAVeryLongNameForAnIntegerVariable00
  Local $ThisIsAVeryLongNameForAnIntegerVariable01
  Local $ThisIsAVeryLongNameForAnIntegerVariable02
  Local $ThisIsAVeryLongNameForAnIntegerVariable03
  Local $ThisIsAVeryLongNameForAnIntegerVariable04
  Local $ThisIsAVeryLongNameForAnIntegerVariable05
  Local $ThisIsAVeryLongNameForAnIntegerVariable06
  Local $ThisIsAVeryLongNameForAnIntegerVariable07
  Local $ThisIsAVeryLongNameForAnIntegerVariable08
  Local $ThisIsAVeryLongNameForAnIntegerVariable09
  Local $ThisIsAVeryLongNameForAnIntegerVariable10
  Local $ThisIsAVeryLongNameForAnIntegerVariable11
  Local $ThisIsAVeryLongNameForAnIntegerVariable12
  Local $ThisIsAVeryLongNameForAnIntegerVariable13
  Local $ThisIsAVeryLongNameForAnIntegerVariable14
  Local $ThisIsAVeryLongNameForAnIntegerVariable15
  Local $ThisIsAVeryLongNameForAnIntegerVariable16
  Local $ThisIsAVeryLongNameForAnIntegerVariable17
  Local $ThisIsAVeryLongNameForAnIntegerVariable18
  Local $ThisIsAVeryLongNameForAnIntegerVariable19
  Local $ThisIsAVeryLongNameForAnIntegerVariable20
  Local $ThisIsAVeryLongNameForAnIntegerVariable21
  Local $ThisIsAVeryLongNameForAnIntegerVariable22
  Local $ThisIsAVeryLongNameForAnIntegerVariable23
  Local $ThisIsAVeryLongNameForAnIntegerVariable24
  Local $ThisIsAVeryLongNameForAnIntegerVariable25
  Local $ThisIsAVeryLongNameForAnIntegerVariable26
  Local $ThisIsAVeryLongNameForAnIntegerVariable27
  Local $ThisIsAVeryLongNameForAnIntegerVariable28
  Local $ThisIsAVeryLongNameForAnIntegerVariable29
  Local $ThisIsAVeryLongNameForAnIntegerVariable30
  Local $ThisIsAVeryLongNameForAnIntegerVariable31
  Local $ThisIsAVeryLongNameForAnIntegerVariable32
  Local $ThisIsAVeryLongNameForAnIntegerVariable33
  Local $ThisIsAVeryLongNameForAnIntegerVariable34
  Local $ThisIsAVeryLongNameForAnIntegerVariable35
  Local $ThisIsAVeryLongNameForAnIntegerVariable36
  Local $ThisIsAVeryLongNameForAnIntegerVariable37
  Local $ThisIsAVeryLongNameForAnIntegerVariable38
  Local $ThisIsAVeryLongNameForAnIntegerVariable39
  Local $ThisIsAVeryLongNameForAnIntegerVariable40
  Local $ThisIsAVeryLongNameForAnIntegerVariable41
  Local $ThisIsAVeryLongNameForAnIntegerVariable42
  Local $ThisIsAVeryLongNameForAnIntegerVariable43
  Local $ThisIsAVeryLongNameForAnIntegerVariable44
  Local $ThisIsAVeryLongNameForAnIntegerVariable45
  Local $ThisIsAVeryLongNameForAnIntegerVariable46
  Local $ThisIsAVeryLongNameForAnIntegerVariable47
  Local $ThisIsAVeryLongNameForAnIntegerVariable48
  Local $ThisIsAVeryLongNameForAnIntegerVariable49
  Local $ThisIsAVeryLongNameForAnIntegerVariable50
  Local $ThisIsAVeryLongNameForAnIntegerVariable51
  Local $ThisIsAVeryLongNameForAnIntegerVariable52
  Local $ThisIsAVeryLongNameForAnIntegerVariable53
  Local $ThisIsAVeryLongNameForAnIntegerVariable54
  Local $ThisIsAVeryLongNameForAnIntegerVariable55
  Local $ThisIsAVeryLongNameForAnIntegerVariable56
  Local $ThisIsAVeryLongNameForAnIntegerVariable57
  Local $ThisIsAVeryLongNameForAnIntegerVariable58
  Local $ThisIsAVeryLongNameForAnIntegerVariable59
  Local $ThisIsAVeryLongNameForAnIntegerVariable60
  Local $ThisIsAVeryLongNameForAnIntegerVariable61
  Local $ThisIsAVeryLongNameForAnIntegerVariable62
  Local $ThisIsAVeryLongNameForAnIntegerVariable63
  Local $ThisIsAVeryLongNameForAnIntegerVariable64
  Local $ThisIsAVeryLongNameForAnIntegerVariable65
  Local $ThisIsAVeryLongNameForAnIntegerVariable66
  Local $ThisIsAVeryLongNameForAnIntegerVariable67
  Local $ThisIsAVeryLongNameForAnIntegerVariable68
  Local $ThisIsAVeryLongNameForAnIntegerVariable69
  Local $ThisIsAVeryLongNameForAnIntegerVariable70
  Local $ThisIsAVeryLongNameForAnIntegerVariable71
  Local $ThisIsAVeryLongNameForAnIntegerVariable72
  Local $ThisIsAVeryLongNameForAnIntegerVariable73
  Local $ThisIsAVeryLongNameForAnIntegerVariable74
  Local $ThisIsAVeryLongNameForAnIntegerVariable75
  Local $ThisIsAVeryLongNameForAnIntegerVariable76
  Local $ThisIsAVeryLongNameForAnIntegerVariable77
  Local $ThisIsAVeryLongNameForAnIntegerVariable78
  Local $ThisIsAVeryLongNameForAnIntegerVariable79
  Local $ThisIsAVeryLongNameForAnIntegerVariable80
  Local $ThisIsAVeryLongNameForAnIntegerVariable81
  Local $ThisIsAVeryLongNameForAnIntegerVariable82
  Local $ThisIsAVeryLongNameForAnIntegerVariable83
  Local $ThisIsAVeryLongNameForAnIntegerVariable84
  Local $ThisIsAVeryLongNameForAnIntegerVariable85
  Local $ThisIsAVeryLongNameForAnIntegerVariable86
  Local $ThisIsAVeryLongNameForAnIntegerVariable87
  Local $ThisIsAVeryLongNameForAnIntegerVariable88
  Local $ThisIsAVeryLongNameForAnIntegerVariable89
  Local $ThisIsAVeryLongNameForAnIntegerVariable90
  Local $ThisIsAVeryLongNameForAnIntegerVariable91
  Local $ThisIsAVeryLongNameForAnIntegerVariable92
  Local $ThisIsAVeryLongNameForAnIntegerVariable93
  Local $ThisIsAVeryLongNameForAnIntegerVariable94
  Local $ThisIsAVeryLongNameForAnIntegerVariable95
  Local $ThisIsAVeryLongNameForAnIntegerVariable96
  Local $ThisIsAVeryLongNameForAnIntegerVariable97
  Local $ThisIsAVeryLongNameForAnIntegerVariable98
  Local $ThisIsAVeryLongNameForAnIntegerVariable99

  For $i = 0 To 10000
    $ThisIsAVeryLongNameForAnIntegerVariable00 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable01 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable02 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable03 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable04 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable05 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable06 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable07 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable08 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable09 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable10 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable11 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable12 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable13 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable14 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable15 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable16 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable17 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable18 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable19 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable20 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable21 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable22 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable23 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable24 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable25 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable26 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable27 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable28 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable29 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable30 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable31 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable32 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable33 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable34 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable35 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable36 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable37 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable38 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable39 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable40 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable41 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable42 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable43 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable44 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable45 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable46 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable47 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable48 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable49 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable50 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable51 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable52 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable53 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable54 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable55 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable56 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable57 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable58 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable59 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable60 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable61 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable62 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable63 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable64 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable65 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable66 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable67 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable68 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable69 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable70 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable71 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable72 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable73 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable74 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable75 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable76 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable77 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable78 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable79 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable80 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable81 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable82 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable83 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable84 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable85 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable86 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable87 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable88 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable89 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable90 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable91 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable92 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable93 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable94 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable95 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable96 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable97 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable98 = $i
    $ThisIsAVeryLongNameForAnIntegerVariable99 = $i
  Next
  Local $iDiff = TimerDiff($hTimer)
  ConsoleWrite( "Time diff long variable names  = " & $iDiff & @CRLF )
EndFunc

Func Example2()
  Local $hTimer = TimerInit()
  Local $i00
  Local $i01
  Local $i02
  Local $i03
  Local $i04
  Local $i05
  Local $i06
  Local $i07
  Local $i08
  Local $i09
  Local $i10
  Local $i11
  Local $i12
  Local $i13
  Local $i14
  Local $i15
  Local $i16
  Local $i17
  Local $i18
  Local $i19
  Local $i20
  Local $i21
  Local $i22
  Local $i23
  Local $i24
  Local $i25
  Local $i26
  Local $i27
  Local $i28
  Local $i29
  Local $i30
  Local $i31
  Local $i32
  Local $i33
  Local $i34
  Local $i35
  Local $i36
  Local $i37
  Local $i38
  Local $i39
  Local $i40
  Local $i41
  Local $i42
  Local $i43
  Local $i44
  Local $i45
  Local $i46
  Local $i47
  Local $i48
  Local $i49
  Local $i50
  Local $i51
  Local $i52
  Local $i53
  Local $i54
  Local $i55
  Local $i56
  Local $i57
  Local $i58
  Local $i59
  Local $i60
  Local $i61
  Local $i62
  Local $i63
  Local $i64
  Local $i65
  Local $i66
  Local $i67
  Local $i68
  Local $i69
  Local $i70
  Local $i71
  Local $i72
  Local $i73
  Local $i74
  Local $i75
  Local $i76
  Local $i77
  Local $i78
  Local $i79
  Local $i80
  Local $i81
  Local $i82
  Local $i83
  Local $i84
  Local $i85
  Local $i86
  Local $i87
  Local $i88
  Local $i89
  Local $i90
  Local $i91
  Local $i92
  Local $i93
  Local $i94
  Local $i95
  Local $i96
  Local $i97
  Local $i98
  Local $i99

  For $i = 0 To 10000
    $i00 = $i
    $i01 = $i
    $i02 = $i
    $i03 = $i
    $i04 = $i
    $i05 = $i
    $i06 = $i
    $i07 = $i
    $i08 = $i
    $i09 = $i
    $i10 = $i
    $i11 = $i
    $i12 = $i
    $i13 = $i
    $i14 = $i
    $i15 = $i
    $i16 = $i
    $i17 = $i
    $i18 = $i
    $i19 = $i
    $i20 = $i
    $i21 = $i
    $i22 = $i
    $i23 = $i
    $i24 = $i
    $i25 = $i
    $i26 = $i
    $i27 = $i
    $i28 = $i
    $i29 = $i
    $i30 = $i
    $i31 = $i
    $i32 = $i
    $i33 = $i
    $i34 = $i
    $i35 = $i
    $i36 = $i
    $i37 = $i
    $i38 = $i
    $i39 = $i
    $i40 = $i
    $i41 = $i
    $i42 = $i
    $i43 = $i
    $i44 = $i
    $i45 = $i
    $i46 = $i
    $i47 = $i
    $i48 = $i
    $i49 = $i
    $i50 = $i
    $i51 = $i
    $i52 = $i
    $i53 = $i
    $i54 = $i
    $i55 = $i
    $i56 = $i
    $i57 = $i
    $i58 = $i
    $i59 = $i
    $i60 = $i
    $i61 = $i
    $i62 = $i
    $i63 = $i
    $i64 = $i
    $i65 = $i
    $i66 = $i
    $i67 = $i
    $i68 = $i
    $i69 = $i
    $i70 = $i
    $i71 = $i
    $i72 = $i
    $i73 = $i
    $i74 = $i
    $i75 = $i
    $i76 = $i
    $i77 = $i
    $i78 = $i
    $i79 = $i
    $i80 = $i
    $i81 = $i
    $i82 = $i
    $i83 = $i
    $i84 = $i
    $i85 = $i
    $i86 = $i
    $i87 = $i
    $i88 = $i
    $i89 = $i
    $i90 = $i
    $i91 = $i
    $i92 = $i
    $i93 = $i
    $i94 = $i
    $i95 = $i
    $i96 = $i
    $i97 = $i
    $i98 = $i
    $i99 = $i
  Next
  Local $iDiff = TimerDiff($hTimer)
  ConsoleWrite( "Time diff short variable names = " & $iDiff & @CRLF )
EndFunc
Link to comment
Share on other sites

It's rather encouraging, I'd say.

10,000 loops and there's an effect, yes ... but nothing bogs down, not really.

I don't think I'll hesitate from using nice, descriptive variable names from here, on.  But, I'll also know there's a way (short name) to turbocharge a cycle-intensive process.

Thanks for that test.

Link to comment
Share on other sites

I am guessing (as I can't test right now) that the long variable names are slower. This is because it parses from left to right, so matching is alot longer in that case.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

guinness, I think you are right.

qwert, 10.000 loops or one. In average the execution time of the first example is more than twice the execution time of the second. This means the execution time is more than 100% longer. Or, since there are 100 variables, in average more than 1% longer per variable. Of course the percents ar only true for this specific example.

What's the impact of long function names? Probably the same. The functions in the standard UDFs have the same left part of the name, which can be rather long. If you are compiling your scripts (I nearly never do), it seems to be a good idea to use the /RM parameter.

Link to comment
Share on other sites

guinness, I think you are right.

Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

JohnOne, Will you add a test script?

For what?

There is a test script already there, what I'm saying is parsing something from left to right would not be any quicker than parsing it from right to left.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

AutoIt works left to right.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I'll add a test script myself tomorrow. I'll just put the unique part of the vars to the left.

Link to comment
Share on other sites

Ah, I see what you're getting at, but still don't think it could possibly make a difference.

The whole variable is the same except for the number at the end, if the number were at the beginning I still doubt it would matter.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

And, I'm absolutely wrong.

Example1()
Example2()

Func Example1()
    Local $hTimer = TimerInit()
    Local $0ThisIsAVeryLongNameForAnIntegerVariable
    Local $1ThisIsAVeryLongNameForAnIntegerVariable
    Local $2ThisIsAVeryLongNameForAnIntegerVariable
    Local $3ThisIsAVeryLongNameForAnIntegerVariable
    Local $4ThisIsAVeryLongNameForAnIntegerVariable
    Local $5ThisIsAVeryLongNameForAnIntegerVariable
    Local $6ThisIsAVeryLongNameForAnIntegerVariable
    Local $7ThisIsAVeryLongNameForAnIntegerVariable
    Local $8ThisIsAVeryLongNameForAnIntegerVariable
    Local $9ThisIsAVeryLongNameForAnIntegerVariable
    Local $10ThisIsAVeryLongNameForAnIntegerVariable
    Local $11ThisIsAVeryLongNameForAnIntegerVariable
    Local $12ThisIsAVeryLongNameForAnIntegerVariable
    Local $13ThisIsAVeryLongNameForAnIntegerVariable
    Local $14ThisIsAVeryLongNameForAnIntegerVariable
    Local $15ThisIsAVeryLongNameForAnIntegerVariable
    Local $16ThisIsAVeryLongNameForAnIntegerVariable
    Local $17ThisIsAVeryLongNameForAnIntegerVariable
    Local $18ThisIsAVeryLongNameForAnIntegerVariable
    Local $19ThisIsAVeryLongNameForAnIntegerVariable
    Local $20ThisIsAVeryLongNameForAnIntegerVariable
    Local $21ThisIsAVeryLongNameForAnIntegerVariable
    Local $22ThisIsAVeryLongNameForAnIntegerVariable
    Local $23ThisIsAVeryLongNameForAnIntegerVariable
    Local $24ThisIsAVeryLongNameForAnIntegerVariable
    Local $25ThisIsAVeryLongNameForAnIntegerVariable
    Local $26ThisIsAVeryLongNameForAnIntegerVariable
    Local $27ThisIsAVeryLongNameForAnIntegerVariable
    Local $28ThisIsAVeryLongNameForAnIntegerVariable
    Local $29ThisIsAVeryLongNameForAnIntegerVariable
    Local $30ThisIsAVeryLongNameForAnIntegerVariable
    Local $31ThisIsAVeryLongNameForAnIntegerVariable
    Local $32ThisIsAVeryLongNameForAnIntegerVariable
    Local $33ThisIsAVeryLongNameForAnIntegerVariable
    Local $34ThisIsAVeryLongNameForAnIntegerVariable
    Local $35ThisIsAVeryLongNameForAnIntegerVariable
    Local $36ThisIsAVeryLongNameForAnIntegerVariable
    Local $37ThisIsAVeryLongNameForAnIntegerVariable
    Local $38ThisIsAVeryLongNameForAnIntegerVariable
    Local $39ThisIsAVeryLongNameForAnIntegerVariable
    Local $40ThisIsAVeryLongNameForAnIntegerVariable
    Local $41ThisIsAVeryLongNameForAnIntegerVariable
    Local $42ThisIsAVeryLongNameForAnIntegerVariable
    Local $43ThisIsAVeryLongNameForAnIntegerVariable
    Local $44ThisIsAVeryLongNameForAnIntegerVariable
    Local $45ThisIsAVeryLongNameForAnIntegerVariable
    Local $46ThisIsAVeryLongNameForAnIntegerVariable
    Local $47ThisIsAVeryLongNameForAnIntegerVariable
    Local $48ThisIsAVeryLongNameForAnIntegerVariable
    Local $49ThisIsAVeryLongNameForAnIntegerVariable
    Local $50ThisIsAVeryLongNameForAnIntegerVariable
    Local $51ThisIsAVeryLongNameForAnIntegerVariable
    Local $52ThisIsAVeryLongNameForAnIntegerVariable
    Local $53ThisIsAVeryLongNameForAnIntegerVariable
    Local $54ThisIsAVeryLongNameForAnIntegerVariable
    Local $55ThisIsAVeryLongNameForAnIntegerVariable
    Local $56ThisIsAVeryLongNameForAnIntegerVariable
    Local $57ThisIsAVeryLongNameForAnIntegerVariable
    Local $58ThisIsAVeryLongNameForAnIntegerVariable
    Local $59ThisIsAVeryLongNameForAnIntegerVariable
    Local $60ThisIsAVeryLongNameForAnIntegerVariable
    Local $61ThisIsAVeryLongNameForAnIntegerVariable
    Local $62ThisIsAVeryLongNameForAnIntegerVariable
    Local $63ThisIsAVeryLongNameForAnIntegerVariable
    Local $64ThisIsAVeryLongNameForAnIntegerVariable
    Local $65ThisIsAVeryLongNameForAnIntegerVariable
    Local $66ThisIsAVeryLongNameForAnIntegerVariable
    Local $67ThisIsAVeryLongNameForAnIntegerVariable
    Local $68ThisIsAVeryLongNameForAnIntegerVariable
    Local $69ThisIsAVeryLongNameForAnIntegerVariable
    Local $70ThisIsAVeryLongNameForAnIntegerVariable
    Local $71ThisIsAVeryLongNameForAnIntegerVariable
    Local $72ThisIsAVeryLongNameForAnIntegerVariable
    Local $73ThisIsAVeryLongNameForAnIntegerVariable
    Local $74ThisIsAVeryLongNameForAnIntegerVariable
    Local $75ThisIsAVeryLongNameForAnIntegerVariable
    Local $76ThisIsAVeryLongNameForAnIntegerVariable
    Local $77ThisIsAVeryLongNameForAnIntegerVariable
    Local $78ThisIsAVeryLongNameForAnIntegerVariable
    Local $79ThisIsAVeryLongNameForAnIntegerVariable
    Local $80ThisIsAVeryLongNameForAnIntegerVariable
    Local $81ThisIsAVeryLongNameForAnIntegerVariable
    Local $82ThisIsAVeryLongNameForAnIntegerVariable
    Local $83ThisIsAVeryLongNameForAnIntegerVariable
    Local $84ThisIsAVeryLongNameForAnIntegerVariable
    Local $85ThisIsAVeryLongNameForAnIntegerVariable
    Local $86ThisIsAVeryLongNameForAnIntegerVariable
    Local $87ThisIsAVeryLongNameForAnIntegerVariable
    Local $88ThisIsAVeryLongNameForAnIntegerVariable
    Local $89ThisIsAVeryLongNameForAnIntegerVariable
    Local $90ThisIsAVeryLongNameForAnIntegerVariable
    Local $91ThisIsAVeryLongNameForAnIntegerVariable
    Local $92ThisIsAVeryLongNameForAnIntegerVariable
    Local $93ThisIsAVeryLongNameForAnIntegerVariable
    Local $94ThisIsAVeryLongNameForAnIntegerVariable
    Local $95ThisIsAVeryLongNameForAnIntegerVariable
    Local $96ThisIsAVeryLongNameForAnIntegerVariable
    Local $97ThisIsAVeryLongNameForAnIntegerVariable
    Local $98ThisIsAVeryLongNameForAnIntegerVariable
    Local $99ThisIsAVeryLongNameForAnIntegerVariable

    For $i = 0 To 10000
        $0ThisIsAVeryLongNameForAnIntegerVariable = $i
        $1ThisIsAVeryLongNameForAnIntegerVariable = $i
        $2ThisIsAVeryLongNameForAnIntegerVariable = $i
        $3ThisIsAVeryLongNameForAnIntegerVariable = $i
        $4ThisIsAVeryLongNameForAnIntegerVariable = $i
        $5ThisIsAVeryLongNameForAnIntegerVariable = $i
        $6ThisIsAVeryLongNameForAnIntegerVariable = $i
        $7ThisIsAVeryLongNameForAnIntegerVariable = $i
        $8ThisIsAVeryLongNameForAnIntegerVariable = $i
        $9ThisIsAVeryLongNameForAnIntegerVariable = $i
        $10ThisIsAVeryLongNameForAnIntegerVariable = $i
        $11ThisIsAVeryLongNameForAnIntegerVariable = $i
        $12ThisIsAVeryLongNameForAnIntegerVariable = $i
        $13ThisIsAVeryLongNameForAnIntegerVariable = $i
        $14ThisIsAVeryLongNameForAnIntegerVariable = $i
        $15ThisIsAVeryLongNameForAnIntegerVariable = $i
        $16ThisIsAVeryLongNameForAnIntegerVariable = $i
        $17ThisIsAVeryLongNameForAnIntegerVariable = $i
        $18ThisIsAVeryLongNameForAnIntegerVariable = $i
        $19ThisIsAVeryLongNameForAnIntegerVariable = $i
        $20ThisIsAVeryLongNameForAnIntegerVariable = $i
        $21ThisIsAVeryLongNameForAnIntegerVariable = $i
        $22ThisIsAVeryLongNameForAnIntegerVariable = $i
        $23ThisIsAVeryLongNameForAnIntegerVariable = $i
        $24ThisIsAVeryLongNameForAnIntegerVariable = $i
        $25ThisIsAVeryLongNameForAnIntegerVariable = $i
        $26ThisIsAVeryLongNameForAnIntegerVariable = $i
        $27ThisIsAVeryLongNameForAnIntegerVariable = $i
        $28ThisIsAVeryLongNameForAnIntegerVariable = $i
        $29ThisIsAVeryLongNameForAnIntegerVariable = $i
        $30ThisIsAVeryLongNameForAnIntegerVariable = $i
        $31ThisIsAVeryLongNameForAnIntegerVariable = $i
        $32ThisIsAVeryLongNameForAnIntegerVariable = $i
        $33ThisIsAVeryLongNameForAnIntegerVariable = $i
        $34ThisIsAVeryLongNameForAnIntegerVariable = $i
        $35ThisIsAVeryLongNameForAnIntegerVariable = $i
        $36ThisIsAVeryLongNameForAnIntegerVariable = $i
        $37ThisIsAVeryLongNameForAnIntegerVariable = $i
        $38ThisIsAVeryLongNameForAnIntegerVariable = $i
        $39ThisIsAVeryLongNameForAnIntegerVariable = $i
        $40ThisIsAVeryLongNameForAnIntegerVariable = $i
        $41ThisIsAVeryLongNameForAnIntegerVariable = $i
        $42ThisIsAVeryLongNameForAnIntegerVariable = $i
        $43ThisIsAVeryLongNameForAnIntegerVariable = $i
        $44ThisIsAVeryLongNameForAnIntegerVariable = $i
        $45ThisIsAVeryLongNameForAnIntegerVariable = $i
        $46ThisIsAVeryLongNameForAnIntegerVariable = $i
        $47ThisIsAVeryLongNameForAnIntegerVariable = $i
        $48ThisIsAVeryLongNameForAnIntegerVariable = $i
        $49ThisIsAVeryLongNameForAnIntegerVariable = $i
        $50ThisIsAVeryLongNameForAnIntegerVariable = $i
        $51ThisIsAVeryLongNameForAnIntegerVariable = $i
        $52ThisIsAVeryLongNameForAnIntegerVariable = $i
        $53ThisIsAVeryLongNameForAnIntegerVariable = $i
        $54ThisIsAVeryLongNameForAnIntegerVariable = $i
        $55ThisIsAVeryLongNameForAnIntegerVariable = $i
        $56ThisIsAVeryLongNameForAnIntegerVariable = $i
        $57ThisIsAVeryLongNameForAnIntegerVariable = $i
        $58ThisIsAVeryLongNameForAnIntegerVariable = $i
        $59ThisIsAVeryLongNameForAnIntegerVariable = $i
        $60ThisIsAVeryLongNameForAnIntegerVariable = $i
        $61ThisIsAVeryLongNameForAnIntegerVariable = $i
        $62ThisIsAVeryLongNameForAnIntegerVariable = $i
        $63ThisIsAVeryLongNameForAnIntegerVariable = $i
        $64ThisIsAVeryLongNameForAnIntegerVariable = $i
        $65ThisIsAVeryLongNameForAnIntegerVariable = $i
        $66ThisIsAVeryLongNameForAnIntegerVariable = $i
        $67ThisIsAVeryLongNameForAnIntegerVariable = $i
        $68ThisIsAVeryLongNameForAnIntegerVariable = $i
        $69ThisIsAVeryLongNameForAnIntegerVariable = $i
        $70ThisIsAVeryLongNameForAnIntegerVariable = $i
        $71ThisIsAVeryLongNameForAnIntegerVariable = $i
        $72ThisIsAVeryLongNameForAnIntegerVariable = $i
        $73ThisIsAVeryLongNameForAnIntegerVariable = $i
        $74ThisIsAVeryLongNameForAnIntegerVariable = $i
        $75ThisIsAVeryLongNameForAnIntegerVariable = $i
        $76ThisIsAVeryLongNameForAnIntegerVariable = $i
        $77ThisIsAVeryLongNameForAnIntegerVariable = $i
        $78ThisIsAVeryLongNameForAnIntegerVariable = $i
        $79ThisIsAVeryLongNameForAnIntegerVariable = $i
        $80ThisIsAVeryLongNameForAnIntegerVariable = $i
        $81ThisIsAVeryLongNameForAnIntegerVariable = $i
        $82ThisIsAVeryLongNameForAnIntegerVariable = $i
        $83ThisIsAVeryLongNameForAnIntegerVariable = $i
        $84ThisIsAVeryLongNameForAnIntegerVariable = $i
        $85ThisIsAVeryLongNameForAnIntegerVariable = $i
        $86ThisIsAVeryLongNameForAnIntegerVariable = $i
        $87ThisIsAVeryLongNameForAnIntegerVariable = $i
        $88ThisIsAVeryLongNameForAnIntegerVariable = $i
        $89ThisIsAVeryLongNameForAnIntegerVariable = $i
        $90ThisIsAVeryLongNameForAnIntegerVariable = $i
        $91ThisIsAVeryLongNameForAnIntegerVariable = $i
        $92ThisIsAVeryLongNameForAnIntegerVariable = $i
        $93ThisIsAVeryLongNameForAnIntegerVariable = $i
        $94ThisIsAVeryLongNameForAnIntegerVariable = $i
        $95ThisIsAVeryLongNameForAnIntegerVariable = $i
        $96ThisIsAVeryLongNameForAnIntegerVariable = $i
        $97ThisIsAVeryLongNameForAnIntegerVariable = $i
        $98ThisIsAVeryLongNameForAnIntegerVariable = $i
        $99ThisIsAVeryLongNameForAnIntegerVariable = $i
    Next
    Local $iDiff = TimerDiff($hTimer)
    ConsoleWrite("Time diff long variable names  = " & $iDiff & @CRLF)
EndFunc   ;==>Example1

Func Example2()
    Local $hTimer = TimerInit()
    Local $i00
    Local $i01
    Local $i02
    Local $i03
    Local $i04
    Local $i05
    Local $i06
    Local $i07
    Local $i08
    Local $i09
    Local $i10
    Local $i11
    Local $i12
    Local $i13
    Local $i14
    Local $i15
    Local $i16
    Local $i17
    Local $i18
    Local $i19
    Local $i20
    Local $i21
    Local $i22
    Local $i23
    Local $i24
    Local $i25
    Local $i26
    Local $i27
    Local $i28
    Local $i29
    Local $i30
    Local $i31
    Local $i32
    Local $i33
    Local $i34
    Local $i35
    Local $i36
    Local $i37
    Local $i38
    Local $i39
    Local $i40
    Local $i41
    Local $i42
    Local $i43
    Local $i44
    Local $i45
    Local $i46
    Local $i47
    Local $i48
    Local $i49
    Local $i50
    Local $i51
    Local $i52
    Local $i53
    Local $i54
    Local $i55
    Local $i56
    Local $i57
    Local $i58
    Local $i59
    Local $i60
    Local $i61
    Local $i62
    Local $i63
    Local $i64
    Local $i65
    Local $i66
    Local $i67
    Local $i68
    Local $i69
    Local $i70
    Local $i71
    Local $i72
    Local $i73
    Local $i74
    Local $i75
    Local $i76
    Local $i77
    Local $i78
    Local $i79
    Local $i80
    Local $i81
    Local $i82
    Local $i83
    Local $i84
    Local $i85
    Local $i86
    Local $i87
    Local $i88
    Local $i89
    Local $i90
    Local $i91
    Local $i92
    Local $i93
    Local $i94
    Local $i95
    Local $i96
    Local $i97
    Local $i98
    Local $i99

    For $i = 0 To 10000
        $i00 = $i
        $i01 = $i
        $i02 = $i
        $i03 = $i
        $i04 = $i
        $i05 = $i
        $i06 = $i
        $i07 = $i
        $i08 = $i
        $i09 = $i
        $i10 = $i
        $i11 = $i
        $i12 = $i
        $i13 = $i
        $i14 = $i
        $i15 = $i
        $i16 = $i
        $i17 = $i
        $i18 = $i
        $i19 = $i
        $i20 = $i
        $i21 = $i
        $i22 = $i
        $i23 = $i
        $i24 = $i
        $i25 = $i
        $i26 = $i
        $i27 = $i
        $i28 = $i
        $i29 = $i
        $i30 = $i
        $i31 = $i
        $i32 = $i
        $i33 = $i
        $i34 = $i
        $i35 = $i
        $i36 = $i
        $i37 = $i
        $i38 = $i
        $i39 = $i
        $i40 = $i
        $i41 = $i
        $i42 = $i
        $i43 = $i
        $i44 = $i
        $i45 = $i
        $i46 = $i
        $i47 = $i
        $i48 = $i
        $i49 = $i
        $i50 = $i
        $i51 = $i
        $i52 = $i
        $i53 = $i
        $i54 = $i
        $i55 = $i
        $i56 = $i
        $i57 = $i
        $i58 = $i
        $i59 = $i
        $i60 = $i
        $i61 = $i
        $i62 = $i
        $i63 = $i
        $i64 = $i
        $i65 = $i
        $i66 = $i
        $i67 = $i
        $i68 = $i
        $i69 = $i
        $i70 = $i
        $i71 = $i
        $i72 = $i
        $i73 = $i
        $i74 = $i
        $i75 = $i
        $i76 = $i
        $i77 = $i
        $i78 = $i
        $i79 = $i
        $i80 = $i
        $i81 = $i
        $i82 = $i
        $i83 = $i
        $i84 = $i
        $i85 = $i
        $i86 = $i
        $i87 = $i
        $i88 = $i
        $i89 = $i
        $i90 = $i
        $i91 = $i
        $i92 = $i
        $i93 = $i
        $i94 = $i
        $i95 = $i
        $i96 = $i
        $i97 = $i
        $i98 = $i
        $i99 = $i
    Next
    Local $iDiff = TimerDiff($hTimer)
    ConsoleWrite("Time diff short variable names = " & $iDiff & @CRLF)
EndFunc   ;==>Example2

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

In 10,000 loops, you're gaining/losing only a 1/4 of a second at best. This is hardly worth all of this effort for the minuscule "gain" in speed you'd get with shortening the variable names.

Considering how slow the rest of AutoIt is, is this really worthwhile?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I agree, and I'm starting to get a bit of deja-vu from the thread. There are though some instances where it might be of benefit, I've done network analysis in the past via packet capture and that's a pretty tight loop.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...