Configuration Settings & Other Tips to make your RhoElements application Run Faster
An overview of the RhoElements performance improvement drive
The great thing about an open developer community is the ability to interact and work at a group and individual level with many of the developers out there. It really allows us to prioritize product feature sets and focus on the things that the greater community feels are a priority. It also allows us to get real-time feedback on the product and address any concerns that may arise in a more agile process. The RhoMobile Suite team really prides itself on being agile and producing a product that not only meets the needs of those developing enterprise cross-platform applications, but also does so with the utmost level of quality and performance. Recently there have been concerns that HTML5 cannot deliver a performant application, and with the latest announcements around Facebook and their application it has even more people wondering.
In the second of a series of blog posts I will discuss the configuration settings present in RhoElements 2.1 which you can tweak to make your applications run faster. If you missed my first blog post a couple of weeks ago you can find it at https://developer.motorolasolutions.com/community/rhomobile-suite/docs/developer-reference/blog/2012/09/24/rhoelements-performance-improvements-1, that's where I shared our latest Motorola WebKit browser for Windows Mobile (Embedded Handheld) / CE. The tips in this blog post are aimed at Windows Mobile / CE users.
What is the configuration file and where is it?
The configuration file is an xml document which is used to define the behaviour of your RhoElements application, you can find a detailed description of it at http://docs.rhomobile.com/rhoelements/ConfigurationSettings along with an explanation of what all the configuration parameters do. If you are using the shared runtime you will find the config file at
If you are using a native RhoElements application you will find your configuration file at
\Program Files\<Your Application Name>\Config\Config.xml
The tips below involve modifying the configuration file used by your application.
Configuring the Hourglass / Wait cursor
By default whenever you navigate from page to page you will see a wait cursor animation appear as a spinning coloured disc. In some circumstances users may see this as visually distracting, especially if navigation times are very low and application users may perceive a performance increase by disabling the wait cursor. For historical reasons the configuration file uses the term 'hourglass' for the wait cursor.
The wait cursor is configured with the following settings:
<GUI> <HourglassEnabled VALUE="1" /> <!-- Set this value to "0" to not display the hourglass --> <HourglassLeft VALUE="" /> <HourglassTop VALUE="" /> </GUI>
To stop the wait cursor displaying you can set the 'HourglassEnabled' parameter to '0'.
Alternatively you can prevent the hourglass module from being preloaded to have the same effect, see http://docs.rhomobile.com/rhoelements/ConfigurationSettings#optimizing-the-runtime.
For more information see the API at http://docs.rhomobile.com/rhoelements/hourglass
Default Meta Tags
Default meta tags are EMML tags which are applied to every page, following a navigation:
<DefaultMetaTags> <MetaTag VALUE="SignatureCapture~left:30;top:130;height:100;bgcolor:#663300;width:200;border:visible;visibility:visible;" /> <MetaTag VALUE="Signal~left:10;top:200;color:#663300;"/> </DefaultMetaTags>
In the above example after a page load the Signature Capture box will be shown at position (30,130) with size (200x100) with a border; the signal indicator will also be shown.
The Scanner is disabled during page navigation, whilst this cannot be configured in version 2.1 it will be configurable in 2.2. Enabling the scanner in a default meta tag will cause the scanner to first be disabled when the navigation starts and then re-enabled after the navigation has finished; this can add as much as half a second to the page load and it is recommended to only enable the scanner on pages where it will be used rather than on every page via a default tag.
Having logging turned on will have only a minor impact on application performance, this is because the logging functionality runs at lower priority to the rest of the application. Nevertheless in order to squeeze every last bit of performance out of your application you can turn logging off using the following configuration settings:
<Logger> <LogProtocol VALUE="FILE"/> <LogPort VALUE="80"/> <LogURI VALUE="file://\Program Files\RhoElements\Log.txt"/> <LogError VALUE="0"/> <!-- Set this to "1" to output error logs --> <LogWarning VALUE="0"/> <LogInfo VALUE="0"/> <LogUser VALUE="0"/> <LogMemory VALUE="0"/> <LogMemPeriod VALUE="5000"/> <LogMaxSize VALUE="100"/> </Logger>
It is however recommended that error logs are still turned on just in case anything critical does go wrong (e.g. incorrect installation), you will have a means to find out why.
The debug controls are:
Disabling Regular Expressions
Regular Expressions are a way for RhoElements applications to recognise EMML 1.0 syntax, http://docs.rhomobile.com/rhoelements/EMMLOverview which means applications written to target Motorola PocketBrowser will work unmodified in RhoElements.
<?xml version = "1.0"?> <RegularEx> <Equivs> </Equivs> <Contents> </Contents> </RegularEx>
If you are using the shared runtime you can find your RegEx.xml file at:
If you are using a native RhoElements application you will find your RegEx file at
\Program Files\<Your Application Name>\Config\RegEx.xml
Removing all regular expressions can increase your Mobile API parsing speed by as much as 10 times. In RhoElements 2.2 there will be a configuration option to disable regular expression parsing by default so there will be no need to modify your RegEx.xml file.
Use of remote viewers
And finally... In the course of performance analysis one issue crops up continuously, the use of remote viewers such as those developed by http://www.soti.net/. Remote viewers are invaluable for mobile application development but by their very nature can impact your device's performance, in order to achieve consistent results it is recommended to disable your remote viewer to get a true picture of your application's performance, also ensuring you have no other CPU intensive tasks running in the background.