Uhm... 600% to 1000% IS a real issue. 6% to 10% would be barely unnoticeable, but this is a really severe impact on effectiveness.
Wtiness the large number of posts where speed or GUI responsiveness is the key.
I'm nowhere attacking AutoIt and on the contrary would love to see this bottleneck fixed quickly to be proud again of the language.
That is a great finding, hope it will help to solve the issue. Thanks a lot. I don,t think it is necessary to find WHEN exactly it has started. Now the problem is to find out WHY ?
It is kind of odd that everyone sees the problem except you @argumentum. You must have unique setup. It would be great if you could change your setup to get the same result of us, and pinpoint the setup solution that makes you invincible...
Such workaround is pretty pointless: as soon as a window is shown, the slowdown happens.
Global $hGui = GUICreate("Snail", 800, 600)
AdlibRegister(timeit, 1000)
Func timeit()
Local $x
Local $t = TimerInit()
For $i = 1 To 500000
$x += 1
Next
ConsoleWrite(TimerDiff($t) & @LF)
EndFunc
Sleep(3200)
GUISetState(@SW_SHOW) ; *6 slow down on W10
;~ MsgBox($MB_TASKMODAL, "", "Now look at times in console after me!") ; *6 slow down on W10
;~ SplashTextOn("", "And during/after splash?") ; doesn't slow things down
Sleep(3000)
Spooning every GUI operation to a distinct process is impossible to deal with. That simply means AutoIt can become 6 times (for me) up to 10 times (for some other users) faster than it actually is after "showing" any kind of window under W10. That is, all of AutoIt GUI programs (old or current) launched under W10.
That's a huge enough reason to drag Jon out of his lockdown cave quickly IMHO (assuming he's still alive).
@trancexx help?
This appears to work.
#include <file.au3>
Local $findUniqueDictionary[5] = ['autoit', 'autoit', 'script', 'script', 'forum']
Local $sFileIn = "TestIn.txt", $sFileOut = "TestOut.txt"
Local $aRecords, $sOut = ""
If FileExists($sFileIn) Then FileDelete($sFileIn)
_FileWriteFromArray($sFileIn, $findUniqueDictionary, Default, Default, @CRLF)
; https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/dictionary-object
Local $oDict = ObjCreate('Scripting.Dictionary')
$oDict.CompareMode = 1 ; 1 - Performs a textual comparison.
If Not _FileReadToArray($sFileIn, $aRecords) Then
MsgBox(4096, "Error", " Error reading file")
Exit
EndIf
For $x = 1 To $aRecords[0]
If $oDict.Exists($aRecords[$x]) Then
$oDict.Item($aRecords[$x]) += 1 ; Increment record's item value.
Else
$oDict.Add($aRecords[$x], 1) ; Add new record
EndIf
Next
; $sOut only contains those records who's item is "1" only. Meaning the record in the file appears only once.
For $x = 1 To $aRecords[0]
If $oDict.item($aRecords[$x]) = 1 Then $sOut &= $aRecords[$x] & @CRLF
Next
If FileExists($sFileOut) Then FileDelete($sFileOut)
FileWrite($sFileOut, $sOut)
ShellExecute($sFileOut)
Sleep(3000)
; Tidy files
FileDelete($sFileIn)
FileDelete($sFileOut)
Previously I tried with below command hoping that second argument is mandatory and it didn't work. RunWait(@ComSpec & " /q /c " & $CMD,@SW_HIDE) It is working only when we give second argument also. RunWait(@ComSpec & " /q /c " & $CMD,@ScriptDir,@SW_HIDE) Thanks for the input.
@comspec is a path to cmd.exe RunWait is a function that once called, autoit script pauses execution until executed program exits. Run is a function that doesn't pause autoit script execution after it's execution. The script continues execution at the same time as the Runned program Runs.