How much footprint does C++ exception handling add

后端 未结 8 1236
有刺的猬
有刺的猬 2020-11-28 05:50

This issue is important especially for embedded development. Exception handling adds some footprint to generated binary output. On the other hand, without exceptions the err

8条回答
  •  囚心锁ツ
    2020-11-28 06:02

    I work in a low latency environment. (sub 300 microseconds for my application in the "chain" of production) Exception handling, in my experience, adds 5-25% execution time depending on the amount you do!

    We don't generally care about binary bloat, but if you get too much bloat then you thrash like crazy, so you need to be careful.

    Just keep the binary reasonable (depends on your setup).

    I do pretty extensive profiling of my systems.
    Other nasty areas:

    Logging

    Persisting (we just don't do this one, or if we do it's in parallel)

提交回复
热议问题