3 ms·
Debug symbols do not need to be paged in so shouldn’t make much/any difference. Compiling with -O3 can increase code size a lot due to inlining, which can be a
by dan-robertson 2y ago
Debug symbols do not need to be paged in so shouldn’t make much/any difference. Compiling with -O3 can increase code size a lot due to inlining, which can be a little bad.
- pests 2y agoMario 64 gets flak for some files not being compiled with optimizations on. There is a YouTuber, whose name I forget at the moment, who has been doing optimization and improvements on it and constantly talks about how this is for the better due to the low instruction cache size and slow speed on the console. Compiling with optimizations explodes code size (unrolling links, inlining, etc) to the point it’s a net loss after factoring in the increased load on the IC.
- chasil 2y agoThe -Os flag optimizes for size. What impact does that have?
- rurban 2y agoThe IC is the instruction cache. Bloated code needs more slow loads from the IC, and even if the performance is faster per cache line, the 50x overhead of added cache loads diminishes all -O3 advantages.
- tjalfi 2y agoKaze Emanuar[0] is the YouTuber you're thinking of. [0] https://www.youtube.com/@KazeN64 https://www.youtube.com/@KazeN64
- pests 2y agoYes thank you!
- taeric 2y agoRight, my humor there was that I'm assuming people specifically did non-debug flags for the build as an optimization. Only for them to still fall short. And understood a little on -O3 possibly increasing code size. I had thought that was more of a concern for tight environments than for most systems? Of course, I'd have assumed that -march=native would be more impactful, but the post indicates otherwise. I said in a top level, but it seems the allocator makes the biggest impact for this application? Would be interesting to see which applications should use different allocators. Would be amazing to see a system where the more likely optimal allocator was default for different applications, based on their typical allocation patterns.
- turol 2y ago> Right, my humor there was that I'm assuming people specifically did non-debug flags for the build as an optimization. It used to be the case that the presence of debug symbols would affect GCC code generation. Nowadays that should be fixed. I think it still affects the speed of compilation so if you're building the whole system from source you might want to avoid it.
- SkiFire13 2y ago> And understood a little on -O3 possibly increasing code size. I had thought that was more of a concern for tight environments than for most systems? Increasing code size too much can result in hot functions not fitting in the icache, and that ultimately can make your program slower.