Discovering JNLua

36 views
Skip to first unread message

Jeffrey Elrod

unread,
Apr 25, 2012, 12:15:07 PM4/25/12
to jnlua-...@googlegroups.com
I just discovered JNLua and plan to experiment with it to see if I can use it in my game project.  If there are any performance tests reports done I would like to see them.

Thanks!
Jeff

Andre Naef

unread,
Apr 26, 2012, 5:14:38 PM4/26/12
to jnlua-...@googlegroups.com

While not a performance test report, I can make the following observation: Java retains the performance of Java, and Lua retrains the performance of Lua.

 

So, the only thing that is new with JNLua is the overhead of transitions between Lua and Java. This includes activities such as JNI transitions, setting up a pcall, dynamic method dispatch, argument checking, etc.

 

JNLua does perform optimizations where reasonable and possible, e.g. by caching dynamic method dispatch results for future calls. However, most of the transition overhead is technically unavoidable given JNLua’s goal of providing an access model to native Lua where bad arguments or out of memory conditions do not cause a JVM crash.

 

So, if you are happy with the Java performance and the Lua performance of your code (each taken for itself), the questions to answer really is how much transition overhead between the two is added into the mix.

 

While not a direct answer to your question, I still hope you find this answer useful.

Jeffrey Elrod

unread,
Apr 30, 2012, 2:56:30 PM4/30/12
to jnlua-...@googlegroups.com
Thanks for your time and contribution. I plan to create a few tests
to see how the way I plan to use JNLua will affect performance.

Jeff

Jeffrey Elrod

unread,
May 7, 2012, 10:30:08 AM5/7/12
to jnlua-...@googlegroups.com
Thanks!  I did find it useful.
Jeff
Reply all
Reply to author
Forward
0 new messages