View Single Post
Old 12-21-2012, 12:04 AM   #294
DuckieTigger
Wizard
DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.
 
DuckieTigger's Avatar
 
Posts: 4,742
Karma: 246906703
Join Date: Dec 2011
Location: USA
Device: Oasis 3, Oasis 2, PW3, PW1, KT
Quote:
Originally Posted by ixtab View Post
Yes, the copy/move operations are pretty slow - a move operation consists of the deletion from one collection, and the adding to another. Each of these database modifications is encapsuled in its own transaction, and takes roughly 500 milliseconds. Internally, this is anything but trivial... Plus of course, there is a lot of state handling happening in CM itself. So yes, it is normal for a "move" operation of 5 items to take about 5 seconds in total.

I have just tried to speed this up somewhat by encapsulating everything in a single transaction, but it only yields a marginal gain (~10 - 20%), and to properly implement it, half of CM would have to be rewritten...

So in short: yes, those database operations simply are expensive.
Thank you for that explanation. When the Kindle moves things in Collections it is always near instant. I suppose it still takes a while to update the database in that case, but the Kindle can afford to make those changes later. As in write a lookup something into ram until the real database is updated.

The speed gain is not worth the hassle to rewrite all the code. This time could be better spent on adding search to PW. Unless, of course, there is another road block added to prevent that.

Keep up the excellent work.
DuckieTigger is offline   Reply With Quote