Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-06-2014, 06:42 AM   #1
ZioNemo
Enthusiast
ZioNemo began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
calibredb slowness: is it expected?

Hi,
my program to automatically transport metadata to Clibre seems to work ok (kudos to Calibre developers!).
Remaining issue (side from the, apparently harmless, exception seen yesterday) is a relative slowness of calibredb.
It takes several seconds to process an entry (I am already cumulating several field updates in a single "calibredb set_metadata").
I am less 1/8 through my large lib (24000+ books) after 12 solid hours.
If this is the pace I need more than four days for a full pass!
Is this "as expected" or am I doing something wrong?

I am currently using:
  1. "calibredb catalog" to get the list of known books.
  2. If book is known use "calibredb catalog -i <ID>" to get metadata
  3. otherwise use "calibredb add -e" to create it and get ID
  4. "calibredb set_metadata <ID> -f <field>:<val> -f <field>:<val> ..." to set missing metadata (only if some metadata changed, but now I'm importing, so all books are "unknown" and thus empty).
This means I do two calibredb calls per-book (the first call is out-of-the-loop).
Is there some way to speed up operations?

TiA

Last edited by ZioNemo; 02-06-2014 at 07:05 AM.
ZioNemo is offline   Reply With Quote
Old 02-06-2014, 07:52 AM   #2
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: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
every time you call calibredb, the entire database has to be read from disk and loaded into memory (that is the way calibre works). Therefore, calling calibredb repeatedly is never going to be very fast.

The only way to speed it up is to use the calibre db interface directly via a python script, which will avoid re-reading the db each time. But since your import is a one time operation, if I were you. I'd just let it chug away, it'll get htere eventually. Do something else in the meantime.
kovidgoyal is online now   Reply With Quote
Old 02-06-2014, 07:53 AM   #3
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
The most obvious way to speed things up would be to use a fast computer with plenty of memory for disk caches and fast hard drives. SSD or even a RAM-drive. Especially the temp folder.

Also try to disable everything not needed, like unplug the network and disable antivirus, while the program is running.
Adoby is offline   Reply With Quote
Old 02-06-2014, 08:34 AM   #4
ZioNemo
Enthusiast
ZioNemo began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
Yup!
It IS chugging away...
I just hope I didn't forget something essential and I'll have to redo it

Obvious solution for calibredb slowness would be to use it to "pass over" commands to a running Calibre (GUI or server), but that would mean a lot of work and I'm unsure it would be worthwhile.

I know a lot of programming languages, but Python is not among them, unfortunately...
perhaps it's time to correct this oversight

Thanks, for the time being
ZioNemo is offline   Reply With Quote
Old 02-06-2014, 01:31 PM   #5
ZioNemo
Enthusiast
ZioNemo began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
Quote:
Originally Posted by Adoby View Post
The most obvious way to speed things up would be to use a fast computer with plenty of memory for disk caches and fast hard drives. SSD or even a RAM-drive. Especially the temp folder.
FYI: I moved the newly created Calibre lib to my smallish SSD and it improved dramatically performance (at least one order of magnitude).
It is now almost bearable
Good catch Adoby!
ZioNemo is offline   Reply With Quote
Old 02-06-2014, 07:36 PM   #6
meeera
Grand Sorcerer
meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.meeera ought to be getting tired of karma fortunes by now.
 
meeera's Avatar
 
Posts: 5,658
Karma: 66417824
Join Date: Dec 2011
Location: Australia
Device: Kobo Libra 2, iPadMini4, iPad4, MBP; support other Kobo/Kindles
Quote:
Originally Posted by ZioNemo View Post
FYI: I moved the newly created Calibre lib to my smallish SSD and it improved dramatically performance (at least one order of magnitude).
Just another voice on this one - Calibre used to be a little slow on my ~5 yo laptop; not horribly so, but startup and big imports/conversions chugged away for a while. Upgraded to a 1yo laptop with SSD and now most operations happen in a few seconds or less.
meeera is offline   Reply With Quote
Reply

Tags
calibredb, slow


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre slowness on Webdav madeira Calibre 4 12-19-2012 06:05 AM
Calibre slowness as library expands microcity Library Management 10 06-14-2012 03:59 PM
PRS-950 Help for terrible slowness/lagging problems with ebooks sun surfer Sony Reader 5 02-05-2012 11:21 PM
Slowness of e-book reader mst Calibre 5 12-19-2010 06:11 PM
Overall slowness iharley Calibre 2 07-06-2010 12:29 AM


All times are GMT -4. The time now is 08:07 PM.


MobileRead.com is a privately owned, operated and funded community.