From: mike b. <wm...@ar...> - 2002-12-31 20:03:29
|
the tiny patch at the bottom of this mail significantly speeds up album page generation for IDS 0.8 and 0.81, and looks like it would work for 0.82 as well. the problem is that fillDateHash is called in both generateAlbum and sortItems, but it really only needs to be called in sortItems. further, generateAlbum always calls fillDateHash regardless of sort type, whereas sortItems is smarter and only calls fillDateHash when sorting by timestamp. i caught this using the DProf perl profiler, which showed IDS was spending most of its time in Image::TIFF getting timestamps from photos, even when not sorting by timestamp. time trials for before and after the patch is applied, using the default intelligent sort method : rezrov ~/public_html/reality % dprofpp albumpage.dpp Total Elapsed Time = 4.123205 Seconds User+System Time = 4.013175 Seconds rezrov ~/public_html/reality % dprofpp albumpage-optimized.dpp Total Elapsed Time = 1.486758 Seconds User+System Time = 1.486758 Seconds these were taken on an old AMD-K6 300mhz machine, so the improvement is somewhat magnified. it's still worthwhile on a faster machine, however. sorting by timestamp speed is improved as well, since fillDateHash was being called twice per file when sorting by timestamp previously, and now is only called once. apologies if this has already been brought up - i poked through the mailing list archives and piet's patches website and didn't spot anything that looked similar. i had submitted this directly to mo...@mu... about a year ago and had never heard anything back - i imagine it got lost in the shuffle someplace. ---mike biesele http://real.ity.org/ rezrov ~/ids-0.81 % diff -c index.cgi index-opt.cgi *** index.cgi Fri Oct 5 17:15:28 2001 --- index-opt.cgi Sun Dec 16 23:56:22 2001 *************** *** 379,388 **** $imagecounter = 0; my($startcounter) = 0; my ($commentedItems) = 'n'; ! ! foreach my $fileName (@itemsToDisplay) { ! fillDateHash($fileName); ! } @itemsToDisplay = sortItems(@itemsToDisplay); # generate album HTML --- 379,390 ---- $imagecounter = 0; my($startcounter) = 0; my ($commentedItems) = 'n'; ! ! # redundant - fillDateHash is called in sortItems when necessary already ! # ! # foreach my $fileName (@itemsToDisplay) { ! # fillDateHash($fileName); ! # } @itemsToDisplay = sortItems(@itemsToDisplay); # generate album HTML > > I think the main "lack of speed" most people are experiencing in IDS is >the amount of time it takes ImageMagick to create the thumbs and the various >image sizes. The speed at which this operation occurs can only be improved >by a faster CPU and possibly a very small amount by a faster hard drive. > FastCGI and modperl are used when a site is expecting a tremendous >amount of traffic, perhaps on the order of one dynamic page requested per >second or higher. That is the point when the script and interpreter startup >overhead starts to load the server down. Implementing FastCGI and/or >modperl support doesn't make any noteable speed increase to a single user. >It just prevents the system from buckling when you get 1,000 visitors / >20,000 page views an hour. > > >Jeff > > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >IDS-devel mailing list >IDS...@li... >https://lists.sourceforge.net/lists/listinfo/ids-devel > |