3 ms·
> C++ doesn't zero-initialize instances before calling the constructor. This is exactly the reason why we use C++ for high performance applications: we don't p
by franzb 13y ago
> C++ doesn't zero-initialize instances before calling the constructor.
This is exactly the reason why we use C++ for high performance applications: we don't pay for features we don't need. On one commercial product I worked on [1], we found out that zero-initialization of 3D vectors was consuming around 5% of the total running time on some scenes.
[1] The CPU kernel of iray: http://www.nvidia.com/object/nvidia-iray.html http://www.nvidia.com/object/nvidia-iray.html
- ygra 13y agoAnd that's the reason the GP said that a pragma to not zero-init would probably be helpful for such cases.