kaimallea/demoinfogo-linux

Slow with -deathscsv

kkthxbye-code opened this issue · 2 comments

The port is a lot slower than demoinfogo.exe when doing -deathscsv:

wine demoinfogo.exe --deathscsv demo.dem  > /dev/null  
10.19s user 
0.24s system 
97% cpu 
10.712 total

./demoinfogo --deathscsv demo.dem > /dev/null
40.86s user 
0.06s system 
99% cpu 
40.926 total

wine demoinfogo.exe demo.dem > /dev/null 
42.27s user 
7.44s system 
99% cpu 
50.006 total

./demoinfogo demo.dem > /dev/null  
50.80s user 
0.09s system 
99% cpu 
50.897 total

O3 optimization makes it faster than demoinfogo.exe with no parameters, and brings -deathscsv closer to valves version.

./demoinfogo --deathscsv demo.dem > /dev/null 
17.75s user 
0.06s system 
99% cpu 
17.817 total

./demoinfogo demo.dem > /dev/null  
26.93s user 
0.10s system 
99% cpu 
27.035 total

Just to show that there is room for optimization, I'm sadly a little rusty in C++, so I don't think I can be of much assistance. Is there any negatives of compiling with -O3?

If it compiles and runs faster, without issue, there's nothing wrong with turning on optimizations. :-D

I totally overlooked adding the optimization switch to the Makefile, so kudos to you for bringing it up. Pull request? I'm lonely in the repo stats. ;)

I went ahead and fixed it in #17 . Seemed silly to ask for a PR to add three characters. 😄