I’m working on a DirectX game and I’m finding that during release builds I’m getting 170fps average, however in debug builds I’m getting ~20fps.
I was wondering if this massive difference is normal between release and debug builds especially since in debug I don’t have any traces being out put? I know there should be a performance gap between debug and release builds, just not this huge surely?
Yes it is entirely normal. Such cases are usually caused by the use of class types like Matrix and Vector that act like normal data types (ie support +, -, * etc) and ASSERTs.
The reason the class types cause such a slow down is because none of the code is inlined where in release it DOES get inlined. This can cause HUGE speed differences and surprisingly so.
ASSERTs are extra work to check the safety of things. Extra work means extra processing time and hence things slow down.
As already mentioend the lack of optimisation also doesn’t help. Although, to some extent, that is reflected in the lack of inlining (Which is an optimisation).