Performance Decrease of LuaJIT

Create issue
Issue #107 resolved
Landon “Karai” Manning created an issue

So I just released a game on the Android store and there are some wonky happenings with Lollipop. Every Lollipop device I've tested on (2012 Nexus 7, HP TouchPad, Nexus 4) has this issue while devices running on an older version (such as my 4.3 Transformer Prime) do not have this issue.

The issue is that my game slows down substantially and grinds to a near halt the longer I play, but only against the CPU. If I play online or against a local human, there is no issue. The game works on Android 4.3, PC, Mac, and Linux but seems to have some issue with Android 5.0.

The game can be found here or if you poke me (Karai) on IRC, I can send you a love file to test with.

Comments (19)

  1. Landon “Karai” Manning reporter

    Another issue I noticed on Android 5.0 that doesn't happen on my tablet (confirmed to actually be running 4.4.2, not 4.3) is that if I minimize the game by pressing the home screen button, then come back to the game, the coordinate system for touches seem to be borked. I need to press upwards of 2 tiles to the right to hit the tile I want. The game works fine if I never need ot check a text message or whathaveyou.

  2. Martin Felis repo owner

    What about the mouse events. Do they also report different coordinates when switching back to the game?

  3. Landon “Karai” Manning reporter

    I haven't check the actual numbers yet (my system is not really set up for testing Android, I need to get on that). I'm mostly confused about what could have changed between Kitkat and Lollipop ???

    If you want to hop on IRC, I'll be around for a few more minutes and I can give you the code to test if you'd like.

  4. Seppi

    If you have any pertaining information, please post it here as well, so others can follow the conversation who have an interest (such as myself!)

  5. Landon “Karai” Manning reporter

    Update: I switched my tablet running 4.4.2 from Dalvik to ART and it made no discernable difference so I think ART probably isn't the issue unless there is a significant difference between Kitkat's ART and Lollipop's. I tested both for the slow down and the coordinate issue.

  6. Landon “Karai” Manning reporter

    Apparently someone running Android 4.4.4 on a Samsung Note 4 has found these bugs too, so it is not exclusive to Android 5.0.

    In this case, turning JIT off seems to fix the slow down, but not the coordinate weirdness. I'm not sure what is causing that, but I can probably circumvent it by not calling love.resize on Android. I'll let you know about that one, too.

  7. Landon “Karai” Manning reporter

    Looking through my code again, I am not even initializing love.resize, let alone using it, so there shouldn't be any resize events happening. With that, I am completely stumped as to why the coordinate space is seemingly resizing.

  8. Martin Felis repo owner

    I created a small test game for the android port which can download from here: https://bitbucket.org/MartinFelis/love_android_test/downloads

    Can you reproduce the coordinate issue with that?

    For the LuaJIT issue: I deliberately used an older version of it as I experienced JIT problems with the current release at the time on a device that I do not have anymore. Can you give different LuaJIT versions a try?

    To test a different LuaJIT version delete jni/LuaJIT-2.0.1/android, replace all files in jni/LuaJIT-2.0.1/ from a different LuaJIT version, and rebuild the LuaJIT binaries using jni/LuaJIT-2.0.1/android/buildandroid.sh (note: this file is part of the Android port, not of LuaJIT). After that you can rebuild the native parts and app with ndk-build, ant, etc.

  9. Martin Felis repo owner

    @karai17 could you figure out whether the coordinate issue is due to the game or a bug in the port? Also were you able to test with a different LuaJIT version?

  10. Jeremy Postelnek

    My phone has this issue. My game just halts everything but audio works fine. I've tried disabling LuaJIT using jit.off() with no change. I'll post some Logcat stuff later if I can get it running, and if needed, I'll give the love file.

  11. Martin Felis repo owner

    It might work. However it is super tricky to reproduce and I do not have any code and device combination that exhibits this phenomenon :/.

  12. Log in to comment