Software Archive
Read-only legacy content

Why is performance so poor compared to Cocoonjs?

Michael_P_1
Beginner
4,213 Views

Hi,

I'm currently working on an HTML5 game and have been using Cocoonjs to create native aps for IOS and Android.  CocoonJs has its problems, most notably no direct AdMob support (they are apparently working on adding that now), but the game's performance once on the devices was pretty good.

I exported the same game to my same Android device via Intel XDK and the games performance was absolutely terrible. It had been silky smooth and had very consistent timing (when exported via cocoonjs).  Once exported via XDK it had an absolutely terrible frame-rate and would alternate between insanely slow and then 2x speed as though it was trying to make up for lost time, yet always with the terrible frame-rate. The game became unplayable.

I thought CocoonJS was based on open-source technology.  Why does XDK compiler create such drastically inferior aps based on the same exact html5 files?

Is this massive performance discrepancy being addressed?

 

Thanks,
Mike

0 Kudos
27 Replies
PaulF_IntelCorp
Employee
3,358 Views

There is no compiler, your app runs inside an HTML5 webview (think of it as an embedded browser). That runtime engine is provided by the target device, the XDK has no control over it. In the case of Android devices, that embedded browser can be replaced. Most Android devices have awful embedded rendering engines. This is why we provide the Crosswalk on Android option, it provides substantially better performance, at the expense of increased size, because it replaces the embedded webview. Please build your Android game using the Crosswalk build option.

See this blog for more details regarding the webview: http://blogs.intel.com/evangelists/2014/09/02/html5-web-app-webview-app

0 Kudos
Michael_P_1
Beginner
3,358 Views

Thanks for the info. I'll give this a try when I get a chance and report back.

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

p.s. If you are building with Crosswalk, specify version 10 of Crosswalk and make sure your viewport meta tag includes "width=device-width" and "minimum-scale=1" to enable GPU hardware acceleration.

0 Kudos
Bill_N_
Beginner
3,358 Views
Hi Paul, I make game from Construct 2 (screen 640,960) then use crosswalk to build android. the result is Fps < 40 so my game is not smooth running or jumping. I tried same source with Cocoonjs webview+ then Fps 50-60 so my game very smooth. I check width and scale and everything is same as your suggestion. Do you have any suggestion for my case? What is different webview between cocoonjs vs crosswalk? Thanks
0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

My understanding is that they are also using Crosswalk as the underlying WebView, but they may have a different version than we do in their build system. Sorry, but I am not privvy to the underlying elements of CocoonJS and their build system, that is proprietary to Ludei and not something we have insight into.

We will have a Crosswalk 11 build available in the near future, you might find better results with that.

0 Kudos
Vijay_R_1
Beginner
3,358 Views

Try Importing the below plugin (from Ludei - CocoonJs) in Your XDK Project and test with the Webview+ bundled with this plugin.

https://github.com/ludei/webview-plus/

0 Kudos
Barry_Johnson
New Contributor I
3,358 Views

Vijay - very curious if you have any experience using their WebView+ plugin on the iOS side and what your thoughts are on it. I would love to get out of the iOS standard webview and into something that isn't actively broken as it regards IndexedDB support (which continues to be broken in the base iOS uiwebview and safari itself I believe).

Thanks!

0 Kudos
Bill_N_
Beginner
3,358 Views

Vijay, Thanks for your comment. Hope I can so my problem so can release my game soon. I will try and feedback the result even now I am still not able to import it yet?

0 Kudos
Bill_N_
Beginner
3,358 Views

Vijay, I have done as below step:

Download your suggest plugin to local and extract to my project folder. from Intel xdk import third party, select import local plugin, select plugin folder in my project path. Build crosswalk and get apk file then install on my phone for testing. The result is same as before Fps < 40.

Is that way correct?

Thanks

0 Kudos
DIA
Beginner
3,358 Views

Cocoon uses a native canvas graphics implementation named CANVAS+. It does not uses a complete webview, cocoon is totally focused on canvas, that is why it is so fast for HTML5 Canvas Games.

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

There is an issue with the "skia" library in the recent Chromium releases that impacts the Crosswalk performance. A fix for that issue is in the works, but is not yet available. When that fix is available it will be part of a new version of Crosswalk and will be available in the XDK. Sorry, but I don't have a timeline for when that fix will be implemented and available in the build system.

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

I believe Crosswalk 15 is the target for the fix.

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

There is a solution coming for that, very soon.

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

@matrix -- the other option, that slimmed down Crosswalk project, is just an experiment, it's not something we can use. At this point they have not made the commitment to turn it into a serious project.

Yes, the shared model is the solution we're offering for a smaller APK, it is now available in the 2170 release. Very aware of the shortcomings of this solution, see this doc page: https://software.intel.com/en-us/xdk/docs/choosing-crosswalk-build-options-shared-or-embedded

0 Kudos
Jacques_L_
Beginner
3,358 Views

Hi,

Just started with IntelXDK. I use Construct 2 for games.

Is it just me, or are the games very slow on Android? Is there a way to get this solved?

Thanks in advance

Jacques

 

 

 

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

Please build with Crosswalk, the standard Android webview is not appropriate for Construct2 games. See these articles for more details:

0 Kudos
Jacques_L_
Beginner
3,358 Views

Thanks Paul, but tried that already, no luck... still laggy, and not just with one project, all of them (10 different games)

Does Intel have something like Canvas+, or DirectCanvas? 

0 Kudos
PaulF_IntelCorp
Employee
3,358 Views

Crosswalk is the solution that nearly all the other Construct2 users have been building against. For comparison, what happens when you build for Crosswalk 7? That is the one that most claim they get the best performance from. Are you building for Crosswalk? If you are previewing with App Preview, using the Test tab, you are NOT using Crosswalk (confusing, I know). If you use the Debug tab you ARE using Crosswalk. The Debug tab will adjust to match the version of Crosswalk you select in the Crosswalk build settings.

If things are laggy with Crosswalk 7 or 14 then there is something else going on...

0 Kudos
Jacques_L_
Beginner
3,358 Views

Hi Paul.

Crosswalk 7 solved the issue! Thank you!

 

 

0 Kudos
Andrea_C_
New Contributor I
3,251 Views

@Jacques, could you please tell me if you see any regressions on Crosswalk 14? You can use the shared beta mode available in the latest version of XDK.

 

 

 

0 Kudos
Reply