Quote:
Originally Posted by silentguy
With a large library (~10.000 books) it takes around 6 seconds to start calibre (with or without my column) but if i tell it to display my column, it takes around 36 seconds to load. Is it really this expensive to build the tag tree? It is there a resource leak somewhere?
|
Yes, it really is that expensive. These columns are not really tags (and cannot be). Computing the list of tags requires:
For every book in the database:
- split the field apart into its component tags (split on comma)
- check if an individual component has been seen before. If not, add it to the tags values data structures.
For real tags fields, this happens once instead of once per book, because the individual tag values are available in the database. In your case, this means that there are 10,000 more loops.
That said, while looking at the code I did notice a few things that I could improve, so performance might get somewhat better.