What to do with Java BigDecimal performance?

后端 未结 20 2516
陌清茗
陌清茗 2020-11-29 17:28

I write currency trading applications for living, so I have to work with monetary values (it\'s a shame that Java still doesn\'t have decimal float type and has nothing to s

20条回答
  •  孤独总比滥情好
    2020-11-29 18:19

    What version of the JDK/JRE are you using?

    Also you might try ArciMath BigDecimal to see if theirs speeds it up for you.

    Edit:

    I remember reading somewhere (I think it was Effective Java) that the BigDecmal class was changed from being JNI called to a C library to all Java at some point... and it got faster from that. So it could be that any arbitrary precision library you use is not going to get you the speed you need.

提交回复
热议问题