Hi folks,
I have done some changes to my string engine and would like to see a few timings. Source is attached, including a "bonus" (C64.asm) that compares Recall to the Masm32 library arrfile$ etc macros using a 64MB file (more (http://www.masm32.com/board/index.php?topic=18364.msg155157#msg155157)).
Intel(R) Celeron(R) M CPU 420 @ 1.60GHz (SSE3)
x86 Family 6 Model 14 Stepping 8, GenuineIntel
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
6486 µs 400 µs
6786 µs 377 µs
6473 µs 385 µs
6021 µs 395 µs
6048 µs 391 µs
6006 µs 385 µs
6560 µs 401 µs
6018 µs 390 µs
6054 µs 389 µs
6008 µs 388 µs
52357 strings, 2045966 bytes
include \masm32\MasmBasic\MasmBasic.inc ; download (http://www.masm32.com/board/index.php?topic=12460) - at least version 28 March 2012 needed
Init
PrintCpu ; print the CPU brand string
PrintLine ExpandEnv$("%PROCESSOR_IDENTIFIER%"), CrLf$ ; another version
Let esi="\Masm32\include\WinBoth.inc"
.if !Exist(esi) ; if it doesn't exist, let's create it
Recall "\Masm32\include\Windows.inc", L$()
FileWrite esi, Cat$(FileRead$("\Masm32\include\Windows.inc")+FileRead$("\Masm32\include\WinExtra.inc"))
.endif
PrintLine "Microseconds for", CrLf$, "1. reading Windows.inc & WinExtra.inc into a string array", CrLf$, "2. plus inserting & deleting 1000 items"
For_ ebx=1 To 10
NanoTimer() ; start timer
Recall esi, L$()
push eax
Print Str$("\n%i µs ", NanoTimer(µs))
NanoTimer() ; start timer
mov ecx, 100 ; just a counter
Insert L$(10), ecx ; insert ecx items at pos zero
Let L$(15)="brandnew" ; assign one of the inserted strings
Delete L$(1111), ecx ; delete ecx items at another position
Print Str$("\t%i µs", NanoTimer(µs))
; Store "MyFile.txt", L$() ; optional: save the result
pop eax
Next
Inkey Str$("\n\n%i strings", eax), Str$(", %i bytes", LastFileSize)
Exit
end start
I really wonder how the same task would perform in another language - C or FreeBasic or PowerBasic...
Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz (SSE4)
Intel64 Family 6 Model 23 Stepping 7, GenuineIntel
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
2207 µs 341 µs
2149 µs 229 µs
2863 µs 160 µs
2209 µs 138 µs
2071 µs 144 µs
1923 µs 246 µs
2776 µs 232 µs
2163 µs 261 µs
2259 µs 154 µs
2077 µs 136 µs
42354 strings, 1659206 bytes
Thanks, fearless. I should have normalised the result - your Win*incs seem to be a bit shorter...
AMD Athlon(tm) Dual Core Processor 4450B (SSE3)
x86 Family 15 Model 107 Stepping 2, AuthenticAMD
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
5787 µs 488 µs
7172 µs 439 µs
6186 µs 369 µs
5608 µs 330 µs
5121 µs 326 µs
6259 µs 325 µs
5305 µs 323 µs
5456 µs 331 µs
5310 µs 484 µs
5440 µs 330 µs
52357 strings, 2045966 bytes
Intel(R) Core(TM)2 Quad CPU Q9650 @ 3.00GHz (SSE4)
x86 Family 6 Model 23 Stepping 10, GenuineIntel
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
2063 µs 136 µs
2365 µs 130 µs
2048 µs 130 µs
2056 µs 130 µs
2038 µs 130 µs
2045 µs 130 µs
2028 µs 130 µs
2036 µs 132 µs
2059 µs 130 µs
2047 µs 132 µs
52360 strings, 1068616 bytes
Intel(R) Core(TM) i7-2700K CPU @ 3.50GHz (SSE4)
Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
1370 µs 85 µs
1448 µs 127 µs
1392 µs 92 µs
1372 µs 116 µs
1370 µs 134 µs
1288 µs 135 µs
1303 µs 133 µs
1283 µs 119 µs
1276 µs 129 µs
1274 µs 114 µs
52357 strings, 2045966 bytes
AMD Phenom(tm) II X6 1100T Processor (SSE3)
AMD64 Family 16 Model 10 Stepping 0, AuthenticAMD
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
3446 µs 142 µs
3264 µs 117 µs
2667 µs 116 µs
2529 µs 118 µs
2634 µs 131 µs
2425 µs 282 µs
2652 µs 273 µs
2681 µs 280 µs
2673 µs 272 µs
2571 µs 274 µs
52357 strings, 2045966 bytes
Good morning Hutch & Sinsi :bg
Quote from: sinsi on March 28, 2012, 12:01:17 PM
1370 µs 85 µs
You have no speed limits down under??
Say hello to SSD :bg
Intel(R) Pentium(R) Dual CPU E2160 @ 1.80GHz (SSE4)
x86 Family 6 Model 15 Stepping 11, GenuineIntel
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
6657 µs 327 µs
7804 µs 312 µs
6775 µs 318 µs
6980 µs 447 µs
6421 µs 393 µs
7397 µs 533 µs
7073 µs 344 µs
7716 µs 335 µs
6584 µs 437 µs
6332 µs 454 µs
52357 strings, 2045966 bytes
Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (SSE4)
Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Microseconds for
1. reading Windows.inc & WinExtra.inc into a string array
2. plus inserting & deleting 1000 items
2574 µs 155 µs
2588 µs 144 µs
2438 µs 144 µs
2391 µs 143 µs
2387 µs 143 µs
2367 µs 144 µs
2444 µs 145 µs
2427 µs 144 µs
2423 µs 145 µs
2385 µs 144 µs
52357 strings, 1068554 bytes
Why "GenuineIntel".. you see this everywhere, even with AMD... I'm curious to know who's going to take the trouble to duplicate a processor this big :bg
Quote from: vanjast on March 28, 2012, 05:48:20 PM
Why "GenuineIntel".. you see this everywhere, even with AMD... I'm curious to know who's going to take the trouble to duplicate a processor this big :bg
It's a Windows environment variable... where did you see GenuineIntel for an AMD processor?
PrintLine ExpandEnv$("%PROCESSOR_IDENTIFIER%")
Sorry, I wasn't clear about the AMD thingy... "AuthenticAMD"
I see, I thought this might be buried in a CPU identification register..
:8)
it is :P
Quote from: vanjast on March 29, 2012, 05:22:42 AM
Sorry, I wasn't clear about the AMD thingy... "AuthenticAMD"
I see, I thought this might be buried in a CPU identification register..
:8)
If you execute a CPUID instruction with EAX set to 0 the bytes in the EBX:EDX:ECX registers spell GenuineIntel, for AMD the EBX:EDX:ECX registers contain AuthenticAMD.