faster Math.exp() via JNI?

前端 未结 15 646
时光取名叫无心
时光取名叫无心 2021-01-11 22:43

I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java\'s Math.exp()

15条回答
  •  自闭症患者
    2021-01-11 23:36

    You'd want to wrap whatever loop's calling Math.exp() in C as well. Otherwise, the overhead of marshalling between Java and C will overwhelm any performance advantage.

提交回复
热议问题