View Single Post
Old 04-24-2011, 01:50 PM   #135
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,482
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kiwidude View Post
Ok, I found the problem thanks to the loan of drMerry's database. It is caused when you have a very large number of duplicates in the group. The problem isn't the search algorithms themselves but the code afterwards which repartitions the groups taking into account exemptions. The performance of this is diabolical in the situation of having say 70 duplicate titles in the group, so something badly wrong in there. Will post a new version when I figure out the exact cause and fix it or dump the approach in favour of another.
One thing that has bitten me is using the 'in' operator on lists. The operator does a linear search! One piece of code I wrote improved in performance by two orders of magnitude when I changed the list to a set, which does hashed lookups. Sometimes I use a dict with a fixed value (e.g. True) for the same thing, because they are hashed as well.
chaley is offline   Reply With Quote