News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Switch macro timings

Started by jj2007, April 24, 2016, 07:34:02 PM

Previous topic - Next topic

hutch--

Each has its advantage, try a table based sequence of 10 1000 1000000 100000000 and you will see why a normal sequential comparison switch is more general purpose. Table based switch statements must work on stored addresses and with wide disparity of value that tables become massive.

TWell

AMD Athlon(tm) II X2 220 Processor 2.8 Ghz
Assembled with AsmC
Result MB:      0, 25 ms
Result Masm32:  0, 2708 ms
Result AsmC:    0, 18 ms

14084   bytes for swMB
27540   bytes for swMasm32
22111   bytes for swAsmC

jj2007


hutch--

 :biggrin:

Try a "switch" statement with a number range like "0, 2gig, 4gig" and see which algo is faster.  :P