Performance enhancements

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
ACTechWorld
Posts: 6
Joined: Sun May 20, 2007 9:19 pm

Performance enhancements

Post 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.
- AC
--------
Serial and X10 controlled video switches.
http://www.tech-world.com
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
ACTechWorld
Posts: 6
Joined: Sun May 20, 2007 9:19 pm

Post 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?
- AC
--------
Serial and X10 controlled video switches.
http://www.tech-world.com
Post Reply