Page 1 of 1

Equal Signs - Test Speed (.= \ = \ := \ = %)

Posted: 29 Nov 2016, 09:11
by V for Vendetta
".=" is fast and faster than "=" (500 000 rows took 5 000 milliseconds):

Code: Select all

File = Text (Test).txt

gui, add, text, w300 r10 center 0x200 vTextBox, Please Wait!!!	;"0x200" center text vertically (but "`n" or "`r`n" will not represent new lines)
gui, show

StartTime = %A_TickCount%

loop, 500000
text .= a_index "`r`n"

guicontrol, , TextBox, Done

FileDelete, %File%		;Delete File

FileAppend, %text%, %File%, UTF-8	;"UTF-8" is the file Encoding \ UTF-16 \ UTF-8-RAW or UTF-16-RAW \ Empty or omitted: the system default ANSI code page, which is also the default setting.

gui, destroy

msgbox, % "Done - " A_TickCount - StartTime

guiclose:
exitapp
"=" is fast but slower than ".=" (500 000 rows took 10 000 milliseconds):

Code: Select all

File = Text (Test).txt

gui, add, text, w300 r10 center 0x200 vTextBox, Please Wait!!!	;"0x200" center text vertically (but "`n" or "`r`n" will not represent new lines)
gui, show

StartTime = %A_TickCount%

loop, 500000
text = %Text%%a_index%`r`n

guicontrol, , TextBox, Done

FileDelete, %File%		;Delete File

FileAppend, %text%, %File%, UTF-8	;"UTF-8" is the file Encoding \ UTF-16 \ UTF-8-RAW or UTF-16-RAW \ Empty or omitted: the system default ANSI code page, which is also the default setting.

gui, destroy

msgbox, % "Done - " A_TickCount - StartTime

guiclose:
exitapp
":=" is slow and the same as "= %" (20 000 rows took 11 000 milliseconds):

Code: Select all

File = Text (Test).txt

gui, add, text, w300 r10 center 0x200 vTextBox, Please Wait!!!	;"0x200" center text vertically (but "`n" or "`r`n" will not represent new lines)
gui, show

StartTime = %A_TickCount%

loop, 20000
text := Text a_index "`r`n"

guicontrol, , TextBox, Done

FileDelete, %File%		;Delete File

FileAppend, %text%, %File%, UTF-8	;"UTF-8" is the file Encoding \ UTF-16 \ UTF-8-RAW or UTF-16-RAW \ Empty or omitted: the system default ANSI code page, which is also the default setting.

gui, destroy

msgbox, % "Done - " A_TickCount - StartTime

guiclose:
exitapp
"= %" is slow and the same as ":=" (20 000 rows took 11 000 milliseconds):

Code: Select all

File = Text (Test).txt

gui, add, text, w300 r10 center 0x200 vTextBox, Please Wait!!!	;"0x200" center text vertically (but "`n" or "`r`n" will not represent new lines)
gui, show

StartTime = %A_TickCount%

loop, 20000
text = % Text a_index "`r`n"

guicontrol, , TextBox, Done

FileDelete, %File%		;Delete File

FileAppend, %text%, %File%, UTF-8	;"UTF-8" is the file Encoding \ UTF-16 \ UTF-8-RAW or UTF-16-RAW \ Empty or omitted: the system default ANSI code page, which is also the default setting.

gui, destroy

msgbox, % "Done - " A_TickCount - StartTime

guiclose:
exitapp

Re: Equal Signs - Test Speed (.= \ = \ := \ = %)

Posted: 29 Nov 2016, 16:25
by Lateralus138
I was actually wondering about this not too long ago, thanks for the info!!! Been planning a few speed tests myself on different things.

Re: Equal Signs - Test Speed (.= \ = \ := \ = %)

Posted: 29 Nov 2016, 16:50
by V for Vendetta
Lateralus138 wrote:I was actually wondering about this not too long ago, thanks for the info!!! Been planning a few speed tests myself on different things.
Yes, it's a useful script! A lot of people do not know about this!

Re: Equal Signs - Test Speed (.= \ = \ := \ = %)

Posted: 29 Nov 2016, 16:59
by just me
Lateralus138 wrote:... , thanks for the info!!!
V for Vendetta wrote:Yes, it's a useful script!

Re: Equal Signs - Test Speed (.= \ = \ := \ = %)

Posted: 29 Nov 2016, 17:36
by V for Vendetta
just me wrote:
Lateralus138 wrote:... , thanks for the info!!!
V for Vendetta wrote:Yes, it's a useful script!
LolLolLolLolLolLolLolLolLolLolLolLolLolLolLolLolLolLolLolLol...!