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
darkberry
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified

slow performance of FileConnection

I'm working on a custom FileExplorer based on JDE's File Explorer Demo. This application opens a folder and displays all the items (folders or files) contained in it. For each element I need to use some extra info (not only url) so I have to open connections to filesystem for each one.

Testing it on real devices, there is a gap of performance between new models (bold, storm) and older ones, like 8300 series, perhaps due to CPU. I have measured times on 8300 and sometimes it gets 200 to 400 ms to open connections to items and read some properties. As result, opening a folder containing several files takes a long time. I have tested File Explorer Demo as well, and it seems faster because it doesn't have to recursively open items, but still it is slow compared to native Blackberry FileExplorer (probably written in c++).

I'd like to optimize the code, but I dont't know really how to do it.

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: slow performance of FileConnection

The BlackBerry Bold, BlackBerry Storm and BlackBerry Curve 8900 do have faster CPUs than older generation BlackBerry handhelds (i.e. 8300 and 8100).  So it is expected to see performance differences there.

 

I recommend using the profiler tool within the BlackBerry JDE.  This can help you to pinpoint the methods you are using that are consuming the most CPU time.  This could help you to eliminate the use of some expensive methods or move them to a background process.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
emac
Posts: 83
Registered: ‎02-03-2009
My Device: 9500/9520/9800/9810
My Carrier: TMobile

Re: slow performance of FileConnection

[ Edited ]

my suggestion is, that you should not create the extended file connection in the "list" part the code - do it on the render time of the list (that's the moment when you need the real data)... I had similar issues during the development of BBFileScout ( http://bb.emacf1.com/bbfilescout.html )...

 

Matthias
Message Edited by emac on 04-27-2009 09:01 PM
[FileScout] | [iMazing] | [GPSLogger II] | [Iconify] | [TOMPlayer]
Please use plain text.
Developer
darkberry
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified

Re: slow performance of FileConnection

I've finally had so bad performance retrieving the info that I moved the code for opening fileConnection to the very moment the user requests it. Of course, I was forced to display only the file name at first, and not other params (file size, etc). Now the application runs really fast. 
Please use plain text.