This object is in archive! 

Performance when deleting track points...

joeloc shared this problem 9 years ago
Closed

... is abysmal. It takes 10(!) seconds to delete a point from a 5000-point-track (Galaxy Note 2). What kind of horrible database package is this? Doesnt Android offer something a little more reasonable? As this is a user interface operation, I expect it to be instantaneous.


With this delay, I find it impossible to correct tracks with a bunch of misplaced points. Like when you enter a building or some such.

Replies (3)

photo
1

Hello joeloc,


this happen to you with every single point on such longer track? Wasn't it just one time issue?


Do you have your database on SD card or in internal memory? (I'm asking as internal memory is usually a lot faster). Also what about database size? Didn't you though about archiving (and later removing) older tracks from your database, to reduce it's size? Well, 10 s is way to much, completely agree.

photo
1

Happens for every point deleted, not just the first time. My tracks.DB is in internal memory and about 200MB with quite a few tracks. Cant see how other tracks should affect this though.


10s is a lot... but even a tenth of a second would be too much already. All user interface actions should be instantaneous, especially those that are likely to be called repeatedly.


Sorry for being a bit UI crazy... but I really like snappy apps :)

photo
1

Fine, testing ...


I've duplicated some tracks in my database and now I have 260 MB big file almost 3 mil points. Deleting single point took me around 5 seconds now.


Test (measuring) shows, that almost 100% of time is consumed by direct SQL query to delete single line with certain ID (delete trackpoint) and change index of previous trackpoint (change one ID). I've tried to add new index over one column, but it speed up a process to around 3 seconds, but increased size of DB by extra 40 MB.


Hard to say. I'm not an database expert, but for me it looks like limit of SQLite database on Android.

photo
1

I feared that SQL sucks big time for this. OK... I guess you cannot change complete database handling, so how about this:


Don't actually delete the point in the main thread but simply mark it as deleted with a flag and update the display. Do the actually database call in the background without blocking the UI.

photo
1

Good evening joeloc,

old topic. Not sure if some performance improvement happens on your side (maybe opposite with increased database side).

I'm closing this topic. The database structure that was made for storing tracks is not optimized for this task and with my skills, I was unable to get more from it. We think about the update of the database to the different format, so maybe it will be automatically solved during this process. We will see.

Menion

Replies have been locked on this page!