What to do with Java BigDecimal performance?

后端 未结 20 2535
陌清茗
陌清茗 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:11

    I know that I'm posting under very old topic, but this was the first topic found by google. Consider moving your calculations to the database from which you probably are taking the data for processing. Also I agree with Gareth Davis who wrote:

    . In most bog standard webapps the overhead of jdbc access and accessing other network resources swamps any benefit of having really quick math.

    In most cases wrong queries have higher impact on performance than math library.

提交回复
热议问题