Which is faster: Stack allocation or Heap allocation

前端 未结 23 1795
悲&欢浪女
悲&欢浪女 2020-11-22 07:40

This question may sound fairly elementary, but this is a debate I had with another developer I work with.

I was taking care to stack allocate things where I could, i

23条回答
  •  伪装坚强ぢ
    2020-11-22 08:04

    Never do premature assumption as other application code and usage can impact your function. So looking at function is isolation is of no use.

    If you are serious with application then VTune it or use any similar profiling tool and look at hotspots.

    Ketan

提交回复
热议问题