Monday 27 November 2006

C drive? E drive? or... D drive!

On Nokia Series 60 phones, there are two memory types for user to choose from, namely as "Phone Memory" (C drive) and "Memory Card" (E drive). Mostly, users should install applications and copy data to memory card, so that they can reserve as much phone memory as possible for other purposes, such as receiving messages. On the other hand, developers will install applications on phone memory, due to lack of expensive memory cards in stock. Thus, users might experiencing something very different, which the developers have ever thought of.

I discovered this tonight, when I tried to develop a program with my E50. Being a developer and a user, I knew that installing application on memory card is far more safe than on phone memory. Not to mention that I want to reserve more phone memory too. At least, if anything goes wrong, I can format the memory card easily with a card reader, while phone memory is hard to clean up. Using the card helps me discover a problem of using memory card: it's 20 times slower than the phone memory.

My application will import some data on first start up. The database it generated is only 67KB. It took less than 3 seconds to generate on emulator, around 27 seconds on phone memory, and nearly 8 minutes on memory card! However, it's quite sure that users will install their applications on memory card 90% of time. What to do? I've try to optimize the importing process, which eventually I'd introduced some memory leak within (I knew they are unclosed database view, but haven't locate and fix all). For nearly 5 hours I was struggling with this damn, slow memory card (both Eagle Tech 256MB and SanDisk 64MB are slow). Well, yes, I also struggled with sleepiness. Finally, I've a solution come up in mind, a lightning solution which might do thing in a flash!

1. copy the orginal database to the D drive, the RAM disk on phone (Yeah, S60 phone has a ram disk, can you believe it?)
2. do the importing on the RAM disk.
3. copy the final file back to the place it came from.

But this mean quite a lot of re-do work now. No sleep...

No comments: