News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Dynamic string array benchmark

Started by hutch--, April 06, 2008, 09:04:42 AM

Previous topic - Next topic

hutch--

This is the next version that stores the array count in the first array member. I get these results on my old PIV.


Benchmarking array methods on 5 million members
1360 ms array create
843 ms array load data
16 ms array read
2156 ms array delete
Press any key to continue ...


I just found an error, the macro name for the array was still that of the dev code.

Here is its replacement, it does not seem to be any slower with the additional register preservation code in it.


    arrget$ MACRO arr,indx
      push esi
      push edi
      mov esi, arr
      mov edi, indx
      mov esi, [esi+edi*4]
      mov eax, esi
      pop edi
      pop esi
      EXITM <eax>
    ENDM


I have updated the attachment.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

Celeron 2.4 GHz, 448 M Ram, Win XP SP1

Benchmarking array methods on 5 million members
2032 ms array create
828 ms array load data
16 ms array read
1906 ms array delete

Ossa

AMD 64 Athlon Mobile
512MB RAM
Win XP Home (SP2) (32-bit)

Benchmarking array methods on 5 million members
1532 ms array create
953 ms array load data
15 ms array read
1563 ms array delete


Ossa
Website (very old): ossa.the-wot.co.uk

MichaelW

P3-500, 512 MB:

Benchmarking array methods on 5 million members
5418 ms array create
4617 ms array load data
170 ms array read
7100 ms array delete


I did a quick cycle count for arrget$ and got 550 cycles for 100 calls, so that's 9 instructions executing in less than 6 cycles.
eschew obfuscation

u

Sempron 3000+, 1GB

Benchmarking array methods on 5 million members
1265 ms array create
875 ms array load data
16 ms array read
1703 ms array delete
Please use a smaller graphic in your signature.

ic2

On my ancient  Intel P111 846MHz  512MB  XP Service Pack 2

.......................................... 1st run
Benchmarking array methods on 5
3896 ms array create
3034 ms array load data
130 ms array read
4837 ms array delete
Press any key to continue ...
............................................. 3rd  run
Benchmarking array methods on
3715 ms array create
2985 ms array load data
130 ms array read
4887 ms array delete
Press any key to continue ...

daydreamer

here is running at 50% capacity
Benchmarking array methods on 5 million members
1453 ms array create
907 ms array load data
15 ms array read
1594 ms array delete
Press any key to continue ...
it would be interesting to compare the runtime allocatiion/realese windows black box does when you exchange this for a static array instead?
unfortunatly windows seem limited to be able to run only one instance of console app, instead i hoped to testrun two instances simultanously to compare what happens if two cores does this simulatanously
instead I end up with two console programs running right after each other :(
so Hutch need to rewrite it for that kinda test on my duo 2 core

hutch--

Magnus,

A static array only has one memory allocation, you chop it up into pointers yourself and it is far faster than variable length string arrays but it cannot handle variable length strings, thats the cost of extra speed.

the test piece is a single thread example, the code can routinely run in as many threads and cores as you want to write.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

NightWare

on core2 duo 2ghz,
Benchmarking array methods on 5 million members
780 ms array create
780 ms array load data
15 ms array read
671 ms array delete
Press any key to continue ...


Rainstorm

core2duo 2.66Ghz 1333mhz/4M winxp pro-sp2
------------------------------------------------------------------
Benchmarking array methods on 5 million members
937 ms array create
547 ms array load data
0 ms array read
938 ms array delete
Press any key to continue ...

Benchmarking array methods on 5 million members
875 ms array create
531 ms array load data
0 ms array read
922 ms array delete
Press any key to continue ...

kermit

c2d 1.8@3Ghz,win xp sp2,2GB
Benchmarking array methods on 5 million members
797 ms array create
531 ms array load data
16 ms array read
875 ms array delete
Press any key to continue ...

FairLight

C2D E6850 @ 3Ghz, 4GB, 32bit XP Pro-SP3

Benchmarking array methods on 5 million members
750 ms array create
484 ms array load data
0 ms array read
781 ms array delete
Press any key to continue ...

herge


Benchmarking array methods on 5 million members
33868 ms array create
27940 ms array load data
802 ms array read
44494 ms array delete
Press any key to continue ...


@433 Mhz XP Pro SP2
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

hutch--

This is the timing for the rewrite of the dynamic string array.


5 million element test

15 ms array create
1891 ms array load data
16 ms array read
2172 ms array delete
Press any key to continue ...


Faster creation but slower array load. This is the example out of the latest beta of masm32.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

herge


Hi Hutch:


bmark.asm(57) : error A2008: syntax error : ,
bmark.asm(76) : error A2008: syntax error : ,
bmark.asm(41) : error A2006: undefined symbol : arralloc$
bmark.asm(93) : error A2006: undefined symbol : arrfree$


Are we missing some macros?

Thanks.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy