javonet

Performance of Javonet

坚强是说给别人听的谎言 提交于 2019-12-25 01:18:29
问题 So far, I've gotten Javonet to work to calling a .net dll. It was as easy as advertised to create the javonet code. However, in my case, I have a loop that runs approx 10 million times, and within that loop, I'm calling a dll method via Javonet. My question is: since I seem to pass the method name as a String to Javonet (based on javonet's way of doing things), I'm assuming that Javonet uses some sort of reflection to find the corresponding dll method...but wouldn't that be slow (when in a 10

How to avoid autoboxing of primitives in arrays in javonet

走远了吗. 提交于 2019-12-24 03:22:31
问题 According to the example in https://www.javonet.com/java-devs/guides/working-with-net-arrays-and-collections-from-java-with-javonet/, if the dll that Java is calling returns an array of ints, Javonet will only display an array of Integer classes (not primitives). Since the arrays are huge in my case (~2GB worth of arrays), is there any way for Javonet to NOT autobox, but instead return an array of primitives? 回答1: We have implemented the mechanism to allow you choosing if Javonet should

Javonet performance 10x slower compared to native .net code? May be due to object array?

风格不统一 提交于 2019-12-11 16:37:11
问题 In another post, I talk about the need for support of primitive array in javonet. Could this explain why pulling ~2GB worth of double array is about 10x slower than comparable code in .net? I've attached a screenshot of JProfiler in case it helps. (Also, though not shown, JProfiler also showed about 1GB of Double objects, which I think should not exist if we just had primitives; but, is this the reason for the slowness or is it because of the ~40,000 calls to a .net method, and all the "stuff