View Single Post
Old 08-03-2013, 11:24 AM   #107
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,429
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You should not need to do anything at all. It may happen that some operations, typically updating a field in the database for many books, one at a time, becomes slower, in which case you should re-write it to use the new api. Other than that, you should not need to do anything, and that only if you or your users notice some slowness. Basically, where you had:

Code:
for book_id in book_ids:
   db.set_something(book_id, value)
replace it with

Code:
db.new_api.set_field(something, {book_id:value for book_id in book_ids})
kovidgoyal is offline   Reply With Quote