i++ less efficient than ++i, how to show this?

前端 未结 9 1743
暖寄归人
暖寄归人 2020-12-03 14:30

I am trying to show by example that the prefix increment is more efficient than the postfix increment.

In theory this makes sense: i++ needs to be able to return the

9条回答
  •  有刺的猬
    2020-12-03 14:59

    You won't see any difference with integers. You need to use iterators or something where post and prefix really do something different. And you need to turn all optimisations on, not off!

提交回复
热议问题