[iOS Performance issue]"Framemove " Taking too much execution time

Hello all,

We are experiencing significant performance issues on iOS devices, with poor FPS and high battery consumption. Upon profiling, we discovered the following:

  • The frameMove function consumes about 25% to 50% of the total execution time.
  • Handling of touch events accounts for significant execution time.

Additionally, we came across few older discussion on the Cocos forum
(Android build rendering options for performance - #13 by zhangxm,
[IOS Game Overheating Issue]) that highlights similar performance concerns. We are curious to know if any performance improvements have been made since then, particularly for iOS builds.

Also while profiling our Cocos Creator project in Xcode, we identified a performance bottleneck in Builtins_InterpreterEntryTrampoline.

These issues are likely from iOS’s restriction on Just-In-Time (JIT) compilation, leading to slower JavaScript execution compared to platforms that allow JIT (such as Android).

Also curious to know how much of a performance difference can be expected with JIT enabled versus without it.

Any suggestions about optimisations or workarounds to improve the performance would be appreciated.
@zhangxm @mr.kylin @pandamicro
Thank you in advance!

Since iOS could not enable JIT for testing, so we could not measure how much of a performance difference on iOS.
But you could compare them on Android by adding --jitless boot flag in cocos/bindings/jswrapper/v8/ScriptEngine.cpp for Android.

        #if (CC_PLATFORM == CC_PLATFORM_IOS) // Modify this line.
        flags.append(" --jitless");
        #endif
        if (!flags.empty()) {
            v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.length()));
        }