Hi there,

I have an additional cache where images are stored on the SD card.
These are loaded pretty fast.
But my data right now consists of many objects with many fields. This
is a totally different use case.

Of course I would not use serialization for images. ;-)


Regards

Marc Reichelt   ||   http://www.marcreichelt.de/

On 25 Nov., 20:21, Streets Of Boston <[email protected]> wrote:
> I use a RandomAccessFile for a thumbnail database. Works pretty fast
> (i haven't done any exact benchmarking).
>
> On Nov 24, 3:09 am, Marc Reichelt <[email protected]> wrote:
>
> > Hi!
>
> > I am writing a program where I have to access some static data, and
> > now I am looking for the best method of how to include them into the
> > project.
>
> > This is what I found out by now:
>
> > 1. Reading in the data by parsing an XML is *slow* (even using the SAX
> > parser).
> > 2. Reading the data by parsing a CSV file is faster than loading an
> > XML, but again is too slow.
> > 3. Putting the data into a Java file directly (e.g. by defining an
> > array) fails because Dalvik says it is too large.
> > 4. Reading in the data using serialization is slow. The funny thing
> > here is: It takes a bit longer than loading the XML file.
> > 5. Reading in the data from a SQLite database is the fastest method
> > until now. But a bad workaround is needed: A SQLite DB can not yet be
> > read directly from the resources, but instead has to be copied to the
> > cache or to the SD card - even for read-only access.
>
> > Right now I am using method 5, but I would really like to use a more
> > simplified and faster solution.
>
> > What I found out: Unserialization in Java is *fast* (reading a HashMap
> > with 5000 integers and strings in 79ms on my PC), while the same
> > action on my G1 takes over 13500ms. I know that I can not compare a PC
> > to a mobile device. But still, there seems to be a big difference
> > here. I think that the JRE directly copies the serialized data to RAM,
> > while Dalvik seems to read every object step by step. Is this going to
> > change in the future?
>
> > And, most interestingly: what do you do to access lots of static
> > information?
>
> > Thanks in advance & happy hacking
>
> > Marc Reichelt   ||  http://www.marcreichelt.de/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to