How are exceptions implemented under the hood?

前端 未结 10 1460
粉色の甜心
粉色の甜心 2020-12-07 07:43

Just about everyone uses them, but many, including me simply take it for granted that they just work.

I am looking for high-quality material. Languages I use are: Ja

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 08:44

    Regarding performance - sparse use of exceptions will probably have negligible effects, but do not abuse them.

    I have personally seen Java code which performed two orders of magnitude worse than it could have (took about x100 the time) because exceptions were used in an important loop instead of more standard if/returns.

提交回复
热议问题