Many people complain about the Intel XDK Crosswalk performance. The real problem is that most of them simply don’t know how to make an app with Intel XDK properly. Crosswalk is based on Chromium and with Intel XDK build system we can (and should) set the proper options for compilation.
Construct 2 Cordova export
If your Intel XDK project directory looks like this then it’s not good.
When exporting project as Cordova, Construct 2 generates intelxdk.config.additions.xml file. The problem is that Intel XDK also generates and uses this file. By exporting Construct 2 project into main Intel XDK project directory, you simply overwrite this file every time.
It’s recommended to create a separate directory under main Intel XDK project directory and save Construct 2 export into this new one. I use www directory as suggested by Intel XDK.
My Intel XDK directory looks like that.
There is no mess and I’m not overwriting any XML file.
Alright but why do we want to keep intelxdk.config.additions.xml file untouched? Because we will set up some compilation options there.
Setting up intelxdk.config.additions.xml
Open intelxdk.config.additions.xml file with any text editor you have. Depends on the plugins you use in your project, you will see some XML nodes inside.
Something like this.
Any third party plugin should be set directly in Intel XDK via Plugin Manager, so we don’t need those entries here. Select everything and delete (CTRL + A, DEL). We want to have a clean file.
Now paste there this code.
<preference name="debuggable" value="false" />
<intelxdk:crosswalk xwalk-command-line="--ignore-gpu-blacklist" />
<intelxdk:crosswalk xwalk-command-line="--disable-pull-to-refresh-effect" />
<preference name="CrosswalkAnimatable" value="false" />
Nothing else should be there (unless you know what you are doing). Save file. Now you can build your project.
So what are those mysterious commands? Simply saying they tell your app how it should behave in specific situations. The most important option is –ignore-gpu-blacklist. With Cordova CLI 4.1.1 it was set up by default, but from CLI 5.1.1 up we have to do it manually.
As Paul F. (Intel) said:
“Including that line will fix the performance issues for 99% of Construct2 Crosswalk builds with the Intel XDK. ”
So I would say that it is a mandatory setting for each build.
Content of this article is a part of my Improve your game performance by up to 400% e-book. If you’d like to read more about performance optimization in Construct 2, consider buying my e-book in Scirra Store [LINK]. Please keep in mind that you can always ask Scirra for a refund if you won’t be satisfied with the content.