Can using non primitive Integer/ Long datatypes too frequently in the application, hurt the performance?

前端 未结 4 1722
孤街浪徒
孤街浪徒 2021-01-20 11:02

I am using Long/Integer data types very frequently in my application, to build Generic datatypes. I fear that using these wrapper objects instead o

4条回答
  •  爱一瞬间的悲伤
    2021-01-20 11:55

    You are better off profiling your application and looking at where your bottlenecks and hot spots are. These are very hard to predict most of the time. IMHO If you are not measuring, you are just guessing.

    However, if you determine that using primitive in a collection would be more efficient, I suggest you try http://trove.starlight-systems.com/ It can make a big difference when it really matters but for 90% of the time, it doesn't.

提交回复
热议问题