Good day to you all,
We have been working on testing RhoElements to see if it can be strong enough to handle the demands we have for our application. Currently our application is specifically made for Windows Mobile, and in the near future we want to move this to a more general platform so that we can run it on multiple devices. That is what we are testing out HTML5 for in combination with RhoElements mostly for hardware coverage.
So far so good, we made our HTML5 application, got a database up and running, testing around a bit in Google Chrome on desktops. And there things worked quite good. However, when we started to run the same tests on tablets (iPad 1 and Motorola Xoom), we see a great decline in performance. Importing 1000 records into a database was undoable on the iPad (crashed Safari) and was highly unpleasant at the Motorola Xoom (long wait time and if interrupted, not all data was inserted).
Now to complete our tests, we also do this on a Motorola MC 55 running in RhoElements. I had to make some tweaks to get it up and running. But in the end I have got it working quite ok. Altho the performance is somewhere in between of the iPad and the Motorola Xoom. Sometimes the application just crashes without useable log entry's to define the problem, and other moments the wait time is so long that this is undesirable.
Now after the, quite long, introduction, my question: Would I be able to upgrade the current solution for adding data to the database so that this would increase the performance of the application?
To create the application I have used this blog entry to get started: https://motorola-dev.hosted.jivesoftware.com/community/mobile_computing/rhoelements/rhoelements_blog/blog/2011/10/01/rhoelements--building-your-first-app--part-4-using-websql
After I got this example working, I have made a couple of changes to it:
- For the purpose of the test I work with one table.
- This single table consists of 23 fields. (8 Integer fields, 11 Text fields, 2 Date fields and 2 real fields, if it matters )
Also made an input fields and a button. Enter a number in the input field and when you click the button, generate and add that number of rows in the database.
Adding 10 rows in the database goes fine, with an average about 2 seconds.
Adding 100 rows becomes quite a bit harder. Takes about 20 seconds.
Adding 500 rows becomes a strain on the system. 107 seconds.
Adding 1000 rows never made it to the end.
As you can see, this goes up quite fast, and comes to a point where it just wont respond anymore.
Could anyone give me some more insight in idea's to optimize the database performance? For example: would it be possible to execute several query's in 1 transaction? This should speed up everything greatly since it doesn't need to open and close the database for every query. Other solutions would be welcome as well of course.
Thanks for reading and hopefully someone could give me a hand in this.