« Soft key labels - Expense Report (5) | Main | Making a phone call programmatically from Android - JPDialer »

18 December 2008

Profiling main screen - Expense Report (6)

The more I have used the Expense Report application and have added expenses, the longer Sony Ericsson W890i has taken to show the main screen. Although I suppose it, it is slower than expectation.  W890i takes 7 seconds to display 50 expense items while Nokia E51 takes 3 seconds. The user can feel like being kept waiting so long if the duration exceeds 5 seconds. Furthermore, because I have not optimised the implementation, the main screen will be instantiated every time the user goes back to it. It means that the user has to wait very long time for the main screen after any operation.

Which part really took so long time? I have measured profiling data so that I could find out the bottleneck in the main screen.

Sony Ericsson's Java ME SDK for CLDC version supports CPU profiling. README file says that the feature is support by JP-8 devices while document does JP-8.3.2. Which is correct? I guess the latter one. This has been confirmed by an error message saying that the device did not support CPU profiling. By the way, I could not figure out which JP-8.3 devices were really JP-8.3.2. You had better use JP-8.4 devices onwards if you would like to try the feature.

I inserted trace outputs in the code and ran Expense Report on the handset. Output to System.out stream scrolled in the window of Device Explorer on my PC. Each output had timestamp generated by System.currentTimeMillis() method, which I imported to Excel and calculate how long each part took.

It took 70 milliseconds to retrieve all expenses from record store and to sort them in date order. Appending nine expenses to List screen took 60 msec for each, and appending the tenth expense took 800 msec. This sequence was repeated five times. According to this result, preparation of the main screen spent most of time. I also tried another variation of List's constructor that accepts arrays of string labels and icons. The result was the same. (In addition to that, MIDP implementation of KDDI's Open Appli Player calls List.insert() method from the constructor, which results in the same problem as the one described in the previous post on 2 December 2008.)

Because preparation of the screen takes time inside MIDP implementation, I cannot do anything more for it. The only workaround can be displaying an “hourglass screen” during preparation, and/or reusing the main screen object until the end of the application's runtime.


« Soft key labels - Expense Report (5) | Main | Making a phone call programmatically from Android - JPDialer »

Expense Report」カテゴリの記事




TrackBack URL for this entry:

Listed below are links to weblogs that reference Profiling main screen - Expense Report (6):

« Soft key labels - Expense Report (5) | Main | Making a phone call programmatically from Android - JPDialer »