[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 1/6] cs-bisection-step: Use pbm tools, not graphicsmagick/imagemagick



Graphicsmagick / imagemagick have very poor performance with images
with large pixel sizes.  The bisector can generate some very large
images.

In an example I have seen, a 21595x21048 png, occupying only 2.6Mby of
disk space.  An invocation of `convert' to resize this was using 3Gby
of RAM and lots of CPU.  Whereas, the pbm utilities can process this
with much less memory and a tiny fraction of the cpu time.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 cs-bisection-step |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/cs-bisection-step b/cs-bisection-step
index d5f8cb8..c9c8bb6 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -992,8 +992,13 @@ END
         }
         1;
     }) {
-        system_checked("convert -resize $c{BisectionRevisonGraphSize}".
-                       " $graphfile.png $graphfile.mini.png");
+       my $gsize = $c{BisectionRevisonGraphSize};
+        system_checked("pngtopnm <$graphfile.png".
+                      " | pnmscale -xysize ".
+                      ($gsize =~ m/^(\d+)x(\d+)$/ ? "$1 $2" :
+                       $gsize =~ m/^(\d+)$/ ? "$1 $1" :
+                       die "$gsize ?").
+                      " | pnmtopng >$graphfile.mini.png");
         print HTML <<END or die $!;
 <h2>Revision graph overview</h2>
 <img src="$href.mini.png">
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.