Code Monkey home page Code Monkey logo

Comments (9)

dumganhar avatar dumganhar commented on May 30, 2024 1

@LuoLuoDev

As above, I wonder that iOS native supports wasm ?

No. V8 wasm depends on JIT enabled.

from cocos-engine.

LuoLuoDev avatar LuoLuoDev commented on May 30, 2024

https://groups.google.com/g/v8-reviews/c/2q_SKUw5ufk/m/e6QOej87AAAJ
image
As above, I wonder that iOS native supports wasm ? @dumganhar

from cocos-engine.

LuoLuoDev avatar LuoLuoDev commented on May 30, 2024

As we known, V8 in ios platform does not have jit and wasm is not supported either. We found that with the complexity of business logic, the execution efficiency of js on the iOS platform is also significantly reduced. We have compiled the v8 engine(version 9.1.269 at cocos engine 3.7.2) . And use instrument to view cpu consumption with jit compiled version and jitless compiled version.

image image

I found that it costs much more cpu in jitless version than jit version. Can you give us some suggestions to improve performance degradation caused by V8 engine not having jit. @dumganhar @jareguo @minggo

from cocos-engine.

minggo avatar minggo commented on May 30, 2024

There is not a good way to fix the jitless issue. If possible, you can implement these codes in c++, and used in javascript.

from cocos-engine.

LuoLuoDev avatar LuoLuoDev commented on May 30, 2024

There is not a good way to fix the jitless issue. If possible, you can implement these codes in c++, and used in javascript.

@minggo Thank you for your professional reply, but I think our business logic is not particularly complex, but the CPU peak is still quite high, accompanied by frame drops and heat generation.
After research, I learned that currently only Apple's own WKWebview has JIT capabilities on the iOS platform. Although WKWebview is not a js runtime environment, js code can be executed through the evaluateJavaScript interface. I would like to ask whether cocos engine could replace the V8 engine on the iOS platform. Is it feasible to explain js programs for WKWebview? I think it is a big project. I would like to know if this is done, is there any other big resistance in cocos?

from cocos-engine.

minggo avatar minggo commented on May 30, 2024

As i know, WKWebview uses jscore which is jit enabled, as WKWebview is implemented by apple. Other apps can use jscore too, but it is jit disabled. cocos supported jscore in early versions, but its performance is bad than v8 core. So cocos uses v8 for all platforms.

from cocos-engine.

LuoLuoDev avatar LuoLuoDev commented on May 30, 2024

As i know, WKWebview uses jscore which is jit enabled, as WKWebview is implemented by apple. Other apps can use jscore too, but it is jit disabled. cocos supported jscore in early versions, but its performance is bad than v8 core. So cocos uses v8 for all platforms.

Thanks for your detailed answer, @minggo. Yes, I agree with what you said. In addition, I am wondering if there is a way to combine cocos engine and WKWebview, such as using the evaluateJavaScript interface to execute js code and use XMLHttpRequest to communicate with native to allow iOS cocos engine to use jit optimization ?

from cocos-engine.

LuoLuoDev avatar LuoLuoDev commented on May 30, 2024

As i know, WKWebview uses jscore which is jit enabled, as WKWebview is implemented by apple. Other apps can use jscore too, but it is jit disabled. cocos supported jscore in early versions, but its performance is bad than v8 core. So cocos uses v8 for all platforms.

Thanks for your detailed answer. Yes, I agree with what you said. In addition, I am wondering if there is a way to combine cocos engine and WKWebview, such as using the evaluateJavaScript interface to execute js code and use XMLHttpRequest to communicate with native to allow iOS cocos engine to use jit optimization ? how about this idea? Is it feasible from a technical perspective in cocos creator engine? @minggo @jareguo

from cocos-engine.

minggo avatar minggo commented on May 30, 2024

If you want to use WKWebview, then you can just export the program as a web app which can run in WKWebView. But it turns to be a web game. I don't think WKWebview can communicate with cocos engine.

from cocos-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.