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
Highlighted
mew
New Member
Posts: 1
Registered: ‎12-30-2010
My Device: Not Specified

File system access (delete and create) - FileConnection

 

Hello!

 

I am developing an app using v5.0.0 of the Blackberry SDK, all is going OK so far, but I have some performance issues with regards to file access.

 

In my app I have two functions:

1. Delete a directory which my app has created (directory will have approx. 100-200 files).

2. Create multiple files at once (100-200).

 

I have found that when deleting the files, this can take quite a few seconds. My implementation is based on a post which I have seen on this forum (recursive method which deletes directory and single files). Each file is opened using FileConnector and then closed once it's deleted.

 

I have a similar problem when creating files - I create a new FileConnection object (via Connector.Open) to a new file. I have found that this can be slow also.

 

Is there a better way to access files quickly in Blackberry? Is there a way to turn off the File Journaler when I am about to create / delete multiple files? When using the Blackberry profiler view in Eclipse, I found that it ranked highest in terms of processor usage.

 

Any tips / tricks would be appreciated, or even if people have encountered similar issues.

 

Many thanks,

 

michael

--

 

 

New Contributor
Posts: 4
Registered: ‎09-10-2011
My Device: 9800
My Carrier: Rogers

Re: File system access (delete and create) - FileConnection

Hello Michael - did you find an answer to this problem?  We are facing the same issue on our end.  Any help with this would be much appreciated.

 

We are finding that it's actually much slower on 9800+ devices.

 

Theo

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: File system access (delete and create) - FileConnection

I have found something similar.  In my experience, lots of files in the one directory was slower that fewer files in multiple directories.  Hope this helps. 

New Contributor
Posts: 4
Registered: ‎09-10-2011
My Device: 9800
My Carrier: Rogers

Re: File system access (delete and create) - FileConnection

Can you elaborate on how much slower or how much directory splitting helped?  We've tried a bunch of different things which have made marginal improvements, but nothing significant.  

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: File system access (delete and create) - FileConnection

I had an application that wrote thousands of small files into a single directory.  I found that the add time depended on the number of files that had preceded it in that directory, In other words the first 100 or so were fast, then they got closer and slower, even though the files were the same size. 

 

Sorry I don't have any times on this, however it was taking minutes to do this process. 

 

As a result, we decided on another approach, which involved having a single file 'archive' with multiple files in it, which we managed ourselves, sort of like a tar file.