开发者

How to choose between IKVM static and dynamic modes?

I'm deploying some Java libraries in my .NET applicatio开发者_如何转开发n. Should I convert the Java libraries into DLLs with ikvmc, or should I use the dynamic features to do the conversion at runtime?

I expect that using ikvmc would cut down on initial load of the application. Does anyone have any experience to verify this? On the other hand, my build process will be considerably simpler if I went the dynamic route.

Theoretically, up-front conversion could also catch conversion errors earlier. However, my test coverage should mitigate this issue.

Also, I imagine that ikvm could cache dynamically-converted assemblies on disk somewhere, so that only the very first load (maybe part of setup) would be slower. I've seen nothing in the ikvm docs to indicate that this is the case, though.


If performance a factor for you then you should convert it to a DLL. The time difference is very large. If you have only a small jar file (some KB) then you can do it because the compile time is linear with the size.

But it is important that you hold a reference to a single instance of the URLClassloader. If you create repeated a new URLClassloader then it must compile ever and ever. Also the JIT cannot work because you use ever new classes.

If you want see how long it take call ikvmc yourJarFile.jar once. This is the time that your program need in additional start time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜