Jump to content
  • Advertisement
Sign in to follow this  
francoisdiy

Experimenting with a Game Interpreter

This topic is 2441 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I wrote this language called C-Lesh to develop my own games for a variety of platforms and devices to ease portability and to revive a project which I started back in 2007. Anyways, I implemented the interpreter in Java for Android 2.1 and noticed how slow the code runs so I went back to drawing board and had the interpreter spit out source code which I could intergrate into an Android project. Code now runs like 3 - 4 times faster.

Now here's my question. How do people do with performance when creating interpreters on Android? Is the NDK (native development kit) of significant help when implementing an interpreter? I'm curious because it says the manual that native code is not necessarily much faster than Java code. The fact of the matter is that the C-Lesh interpreter does not do much overhead in interpreting code. Has anyone messed with Java native code and doesn't the Android JVM convert most of its bytecode into native code?

Some feedback would be much appreciated!

Share this post


Link to post
Share on other sites
Advertisement
It is an interesting question. You are right that the better emulators probably do generate JIT-compiled code, either that or they are emulating machines that are orders of magnitude slower than the target processor.

Share this post


Link to post
Share on other sites
It would be hard, but if you figured out how to get your compiler to output ARM code into a shared library (.so) file, you could then call [color=#000000][font=Arial,]System.loadLibrary() to load the JIT compiled script code. [/font]

[color=#000000][font=Arial,]I have also read that NDK compiled code is not much faster, but in my experience it makes a significant difference![/font]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!