viti95 / FastDoom

Doom port for DOS, optimized to be as fast as possible!
378 stars 26 forks source link

Mixed optimization flags #144

Open RamonUnch opened 1 year ago

RamonUnch commented 1 year ago

I was playing with the build parameters of djdoom and I realized that I would get a small ~1.5% performance boost (on a 486dx2 emulated by PCEM) by optimizing some files for size instead of speed those files are am_map.c m_menu.c. It might be interesting to see if the same can be applied to FastDoom, The important performance part is more about the game-play and all that is menu/automap, intermission screen etc. can be size-optimized, as any slowdown will not significantly impact user experience. The same can probably be true for initialization code that is called only once. This will help with overall performances. I am not yet familiar enough with the source to guess which files should be size optimized.

Maybe with OpenWatcom there would be no difference because the generated code tend to be small anyway.

maxxoccupancy commented 4 months ago

-Os turns on all optimizations for -O2, except those that increase the size of the code. This often produces code that fits better on the L1 ICache and even places less contention on the L2 unified cache.

I've never understood why there weren't also size conscious versions of -O3 and -Ofast.