|
![](/i/fill.gif) |
Well, I was wrong. There's no difference in speed if using #defined
integers or an enum type.
I made a program that generates two programs, one with 5000 #defines and
another with an enum of 5000 items. Then the program loops through all
those 5000 values 100000 times (ie. 500000000 loops in total) with a
switch-structure inside (each branch adds a value to a variable).
There's no remarkable difference in speed between the two.
(I can post the source code of the program if anyone wants it...)
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |