最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What js 'engine' does cordova use? - Stack Overflow

programmeradmin1浏览0评论

What JS 'engine' does Cordova use? Is it platform specific or is it one standard across all platforms? Meaning safari for iOS and chrome for Android, and possible IE standards for windows? Or a 'Cordova JS' engine across all platforms.

More specifically i read that it depends on the browser JS implementation for what sorting algorithm .sort() uses (Mozilla uses merge-sort). And i was considering using a merge-sort function i created or the standard .sort() function. (which could be a merge-sort anyway). The built in .sort() seems to be about 10ms quicker, or about 14% quicker.

Only reason I would want to use my merge-sort (slower) is because I know for sure it will be implemented exactly the same across iOS, windows, android, etc...

What JS 'engine' does Cordova use? Is it platform specific or is it one standard across all platforms? Meaning safari for iOS and chrome for Android, and possible IE standards for windows? Or a 'Cordova JS' engine across all platforms.

More specifically i read that it depends on the browser JS implementation for what sorting algorithm .sort() uses (Mozilla uses merge-sort). And i was considering using a merge-sort function i created or the standard .sort() function. (which could be a merge-sort anyway). The built in .sort() seems to be about 10ms quicker, or about 14% quicker.

Only reason I would want to use my merge-sort (slower) is because I know for sure it will be implemented exactly the same across iOS, windows, android, etc...

Share Improve this question asked Feb 26, 2016 at 22:35 slowswordslowsword 3142 silver badges15 bronze badges 3
  • Uhhh, when would it matter if a JS engine on one platform happened to use a different algorithm for .sort()? The end result should be the same, right? – jfriend00 Commented Feb 26, 2016 at 22:38
  • your probably right, but it was more of a thought question really – slowsword Commented Feb 26, 2016 at 22:39
  • add plugin crosswalk webview so program just use one platform and make app faster – Cagri Tacyildiz Commented Feb 26, 2016 at 22:39
Add a ment  | 

2 Answers 2

Reset to default 8

On Android it uses Android WebView which is based on Chromium, and uses the V8 JavaScript engine.

On iOS, as of iOS8 it uses the WKWebView which is based on Safari and uses the Nitro JavaScript engine.

On other platforms... well, whatever the native web view is.

Cordova is, at the end of the day, a native app with a web view embedded inside, and it uses the web browser ponent specific to the platform where the app is deployed.

If you wish to use another Web browser ponent is still possible. Take a look at Crosswalk.

发布评论

评论列表(0)

  1. 暂无评论