The Airsource Blog

Persistent Storage Performance on BlackBerry Curve 8300

There are three persistent storage methods available directly for Java CLDC applications on BlackBerry devices:

  1. The MIDP record store
  2. RIM's persistent object API
  3. The file system, which is newly available in version 4.2 of the OS, and permits storage of multimedia files.

The record store and persistent object API are typically used by applications for storing configuration and other data so that it is hidden from other applications. We thought it would be interesting to compare the MIDP record store and the persistent object API, since they probably share at least some of the same underlying implementation, but code using the record store should be easier to port to other devices.

We tested reading and writing a 10-byte buffer to/from persistent storage, using each of the MIDP record store interface (javax.microedition.rms) and the RIM persistent object interface (net.rim.device.api), on a BlackBerry Curve 8300 running BlackBerry OS v4.2.2.114 (platform 2.4.0.53):

Writes Reads
Persistent Object Store 18.5 ± 0.4 ms/write 13.6 ± 0.2 us /read
MIDP Record Store 16.7 ± 0.3 ms/write 57.7 ± 4.6 us/read

These were estimated using 10 runs of 1000 writes and 10 runs of 10000 reads; the ± figures denote standard deviation. Note how read speed is an order of magnitude faster than write.

The persistent object store read takes about a quarter of the time of the MIDP record store read, presumably because no copy is required (the persistent object store just returns a reference to an already instantiated object) and there is no indexing overhead, just a hash table lookup to find the reference.

So, use the Persistent Object Store unless you really value the additional portability or the 2 ms time difference on writes.