Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified
Accepted Solution

Performance Problems with Localization on 4.6.1

[ Edited ]

My application runs fine on a number of devices, including 7130e, 8703e, 8820, Pearl (8110, 8120, 8130), Pearl Flip (8220), Curve 8300 series, Bold, and Storm (9500 and 9530).  It has been tested on 4.2.1, 4.2.2, 4.3.0, 4.5.0, 4.6.0, 4.6.1, and 4.7.0.  So far, the only problems we've seen are on the Curve 8350i and 8900.  Both of these devices run 4.6.1 (as far as I know, these are the only devices that run 4.6.1).

 

I determined that the performance problems occur when more localization resources are added to the application (nine total, including English).  The application runs fine with just English support.  English plus one additional language is also fine.  If the applications is built with English plus two additional languages, we see noticeable performance problems.  Again, this only affects the 8350i and 8900.  All other devices and software versions seem fine.  We usually build with JDE 4.2.1 to ensure compatibilty, but I've tested with JDE 4.6.1 with the same poor results.

 

The application is a UiApplication that usually runs in the background, so it is not making heavy use of localization resources.  Additionally, the performance problems we see are in a TimerTask that is totally unrelated to the GUI.  The TimerTask is using the EventInjector at regular intervals.

 

Has anyone seen similar problems with 4.6.1 and multiple localization files?  Are there any recommeded work-arounds?  Is there any way to profile my application on the device to see where the problems are happening?  I'm not doing anything to manage the resource files myself.  I use ResourceBundle.getBundle to get my bundle family and then use getString throughout the application.  Is there a better way?

 

Thanks. 

 

P.S. The 8900 is running 4.6.1.114.  The 8350i has 4.6.1.223.  We've also tried 4.6.1.204 and 4.6.1.83 on the 8350i.

Message Edited by almeida on 06-23-2009 06:17 PM
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Performance Problems with Localization on 4.6.1

Report this issue to devsupport@rim.com

 

I think there is something wrong with resource processing by compiler.

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Performance Problems with Localization on 4.6.1

i did not run into these problems yet, i currently use only four languages.
i do also build with 4.2.1 and address my resouces using a getString on
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME)
(so i guess it is the same)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Performance Problems with Localization on 4.6.1

[ Edited ]

Thanks for the responses.  I investigated further.  It seems that the problem might not be related to localization.  I've reduced my 36 class, 5000+ line application to a single class of just 30 lines, including whitespace, imports, etc..  I removed all localization.  The only GUI element remaining is a single, empty MainScreen.  The application itself fits in a single .cod file.  But, if I include ~250 KB of other resources (e.g., text files, etc.) in the application, it balloons up to five .cod files and performance drops by a factor of two.  As I remove more and more of those resources the application size (and number of .cod files) drops and performance steadily improves.  Once all of the resources have been removed, performance on an 8350i matches every other phone I've tested on.  If I remove the resources from the full application, I see the expected performance too.  That seems to rule out my code as the problem.  As tbilisoft says, maybe it is a resource processing problem.

 

(Edit: The resources are only 250 KB.  I originally said they were 500 KB.) 

Message Edited by almeida on 06-26-2009 04:23 PM
Developer
Posts: 163
Registered: ‎07-16-2008
My Device: Not Specified
My Carrier: Sprint

Re: Performance Problems with Localization on 4.6.1

If you have not already, you should also post your findings to the related issue tracker defect.

https://www.blackberry.com/jira/browse/JAVAAPI-121

Andrew Cowart | Metova
www.metova.com
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Performance Problems with Localization on 4.6.1

I just updated the ticket.  Thanks for reminding me.
Highlighted
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Performance Problems with Localization on 4.6.1

No one is going to believe this, but here goes...

 

I wanted to send my test application to RIM so they could see the issue.  Before I sent it, I decided to clean the code a little. In the process, I renamed the package from "com.z..." (my company's name) to "com.example."  Once I made that change, the test application started running at full speed.  I tested "com.google" and it ran full speed too.  I tested "com.z..." again it was half speed.  "com.zazz" is half speed.  I added an "e" to the front of my company's name and it's back to full speed.

 

I went back to the full application and made the same change to the package name.  It now runs at full speed too.  I will be updating the ticket with this information soon.

 

This is the most bizarre bug I've ever seen.  I would have never found the problem if I hadn't tried to clean the code before submitting it to RIM.

Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Performance Problems with Localization on 4.6.1

I just uploaded sample application to the issue tracker.  If I put my sample application in a package called "a" it runs fast.  If I put it in a package called "z," it runs slow.  The more resources I add to the application, the slower the "z" package runs.  So strange.
Developer
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Performance Problems with Localization on 4.6.1


almeida wrote:

No one is going to believe this, but here goes...

 



You are correct, no one is going to believe you =)

 

Can this be re-produced in the simulator? Or only on 4.6.1 devices?

Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Performance Problems with Localization on 4.6.1

Sadly, I cannot reproduce it on the 8350i or 8900 simulators.  Unless you have the real device, you're just going to have to trust me Smiley Happy