qwert Posted January 26, 2015 Posted January 26, 2015 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.
Moderators Melba23 Posted January 26, 2015 Moderators Posted January 26, 2015 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 namesSo now you can have the best of both worlds - sensible variable names for coding and short ones for running. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
qwert Posted January 26, 2015 Author Posted January 26, 2015 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.
guinness Posted January 26, 2015 Posted January 26, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
qwert Posted January 26, 2015 Author Posted January 26, 2015 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.
LarsJ Posted January 27, 2015 Posted January 27, 2015 I find this test surprising. Or am I doing anything wrong? expandcollapse popupExample1() 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 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
czardas Posted January 27, 2015 Posted January 27, 2015 I see nothing wrong with that test. It is rather revealing. operator64 ArrayWorkshop
qwert Posted January 27, 2015 Author Posted January 27, 2015 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.
guinness Posted January 27, 2015 Posted January 27, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
JohnOne Posted January 27, 2015 Posted January 27, 2015 I doubt that would be it, I'd imagine it's simply the length, which is the same from left to right as it is right to left. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
LarsJ Posted January 27, 2015 Posted January 27, 2015 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. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
guinness Posted January 27, 2015 Posted January 27, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
LarsJ Posted January 27, 2015 Posted January 27, 2015 JohnOne, Will you add a test script? Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
JohnOne Posted January 27, 2015 Posted January 27, 2015 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.
guinness Posted January 27, 2015 Posted January 27, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
LarsJ Posted January 27, 2015 Posted January 27, 2015 I'll add a test script myself tomorrow. I'll just put the unique part of the vars to the left. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
JohnOne Posted January 27, 2015 Posted January 27, 2015 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.
JohnOne Posted January 27, 2015 Posted January 27, 2015 And, I'm absolutely wrong. expandcollapse popupExample1() 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.
BrewManNH Posted January 27, 2015 Posted January 27, 2015 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 GudeHow 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
JohnOne Posted January 27, 2015 Posted January 27, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now