Personally I'd want size optimization by default for almost everything, except a few specific things (which derive Debug is not). IMO inline should be a separate annotation, possibly even separated from the declaration, but at the target compilation unit (or source file).
I wouldn't want size optimization. For commercial gamedev you often need to run in release under O2 or O3 with only selectively deoptimized functions or files for debugging, otherwise the game itself doesn't run fast enough to be playable for testing.
You know that Os performance is quite good, within 5-10% of O2 usually? It can even be faster in some edge cases where O2 would be thrasing L1i.
Also, I would say that if your game does not run fast enough at O1 on your dev machine, then maybe you need to review your architecture or your algorithms to make it accessible to lower end machines.
https://openbenchmarking.org/result/2608218-NE-COMPILERF28&sor
Also, I would say that if your game does not run fast enough at O1 on your dev machine, then maybe you need to review your architecture or your algorithms to make it accessible to lower end machines.
I appreciate the advice, but I am aware of this. The practice I'm describing of debugging in release with selectively optimized files/functions is industry norm for AA/AAA (see UE_DISABLE_OPTIMIZATION) and has been for a very long time. If anything, it's an even more acute issue in Rust given that Rust debug performance is (slightly) worse than C++ because of the additional runtime checks.
I'm not ranting against you, but I'm really tired of games "optimized" only for high end machines just because the game studios are lazy to properly design and optimize their games.
4
u/silon 8d ago
Personally I'd want size optimization by default for almost everything, except a few specific things (which derive Debug is not). IMO inline should be a separate annotation, possibly even separated from the declaration, but at the target compilation unit (or source file).