From 0c8941fc5b463c4d8225e314ffd5da517953f98a Mon Sep 17 00:00:00 2001 From: Michael Save Date: Sun, 18 Mar 2012 01:00:58 +1100 Subject: [PATCH] benchmark.php: Benchmark thumbnailing methods --- tools/benchmark.php | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tools/benchmark.php diff --git a/tools/benchmark.php b/tools/benchmark.php new file mode 100755 index 00000000..60aba638 --- /dev/null +++ b/tools/benchmark.php @@ -0,0 +1,52 @@ +#!/usr/bin/php +resize( + $config['thumb_ext'] ? $config['thumb_ext'] : $extension, + $config['thumb_width'], + $config['thumb_height'] + ); + + $thumb->to($out); + $thumb->_destroy(); + $image->destroy(); + } + $end = microtime(true); + + printf("Took %.2f seconds (%.2f/second; %.2f ms)\n", $end - $start, $rate = ($count / ($end - $start)), 1000 / $rate); + + unlink($out); + } + + benchmark('gd'); + benchmark('imagick'); + benchmark('convert'); +