Thread: Word Count
View Single Post
Old 04-19-2011, 06:31 AM   #22
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by chaley View Post
@idolse: yes, that is what I mean by precomputed. If the plugin populates a integer (or float?) custom column, then the performance penalty during search & sort is close to zero.

As for how often things are computed: certainly doing a word count on thousands of books will take a while. You might consider storing the date the format was last changed (database2.format_last_modified) in plugin storage (use the per-book persistent data feature). You could then provide an 'update' function that compares the stored date with the format's current date, and recompute the count only if the format has changed.

You might also consider working through the formats in some order until you find one that is not DRM infested.
Cool, sounds like a plan then. I'll start simple and if it seems popular I'll look into those additional niceties.
ldolse is offline   Reply With Quote