Page 1 of 1

Performance enhancements

Posted: Thu May 24, 2007 7:30 pm
by ACTechWorld
Using ImageMagick's convert utility to resize jpegs is much faster:

in zm_funcs.php getImageSrc():

Code: Select all

$command = ZM_PATH_NETPBM."/convert -size ".ZM_WEB_LIST_THUMB_WIDTH."x".ZM_WEB_LIST_THUMB_HEIGHT." $image_path $thumb_path";
vs.

Code: Select all

 $command = ZM_PATH_NETPBM."/jpegtopnm -quiet -dct fast $image_path | ".ZM_PATH_NETPBM."/pnmscalefixed -quiet $fraction | ".ZM_PATH_NETPBM."/pnmtojpeg -quiet -dct=fast > $thumb_path";
To display a 25 event list on my system, ImageMagick takes 5 seconds vs. 85 seconds with existing tools.



In MySQL queries that return a single item from a sorted list, e.g. in zm_funcs.cpp, createListThumbnail(), using LIMIT 1 is marginally faster than using LIMIT 0,1. But in lists, marginally adds up.

Posted: Thu May 24, 2007 7:38 pm
by cordel
Wow
It shouldn't be that slow. Mine displays a full page in under 5 seconds with netpbm. Are you sure there is not an underlying problem? That seems awfull long.

Posted: Thu May 24, 2007 9:27 pm
by ACTechWorld
It's a slow machine, 1.4Ghz running Apache, zm, mysql, and VNC.
But the same process is pretty zippy from the command line.

I upgraded to NetPBM 10.33, no joy.

I also recoded the image conversion section to create intermediate files to see if there was a problem piping the data, but no joy there either.

Files are small, 640x480 to 160x120, resulting files are 5-6KB, full size images are 55KB.

No errors logging anywhere.

I'm looking to see if there are any PHP exec fixes that can help. But nevertheless, ImageMagick is much faster.

How fast does your run with the ImageMagick call?