Frog Blog uses Favatars, a favicon.ico / avatar plugin. Recently (after a server upgrade) we had to rebuild the favatar index on 25,000 comments, and this ... was going to take a while. About seven hours. Ugh.
After a look at the favatars code, it was pretty obvious what needed to be done. So here, thanks to the environmentally conscious open source movement, is a much faster favatars.php. (More like five minutes. Aaah.)
Still not entirely certain why there's a sleep(1) in there, to be honest. But given that we shaved six hours and fifty-five minutes off the run time already, it should be OK to leave that in ... don't you think?
Download the updated (nominally, 2.1) revision of favatars.php here.
Update posted to http://dev.wp-plugins.org/wiki/favatars also, but WordPress plugins doesn't give me edit rights yet, so here it is for all the world. Enjoy.
Comments
wow, going from 7 hours to 5
wow, going from 7 hours to 5 minutes to run a query, how many electrons must that save? :-)
heaps and heaps! i have
heaps and heaps! i have always had a deep sympathy for dropped packets. in fact i was a founding member of the packet preservation society back in the early days of the intarweb.
and ... even more if you count the electrons in your brain, staring at the screen :)
Great update! A few
Great update!
A few suggestions:
- Option to use CURL instead fopen, because many hostings don't allow it. (it is already a favatars with curl implemented here: http://billy-charles.com/2006/02/09/favatars/)
- Option tu set a default icon if the comment_favicon function returns none
Thanks!
Post new comment