Open
Description
Hi folks,
I'm noticing a significant performance difference when running the same Imagick script on PHP 7.2 versus PHP 8.2. Here are the results I’ve gathered:
PHP 7.2, ImageMagick 7.0.7, Imagick 3.44: 3.44 seconds
PHP 8.2, ImageMagick 7.1, Imagick 3.7: 13.32 seconds
Same spec machine etc.
I’m wondering if anyone has encountered similar issues or knows why this change between PHP versions might be affecting Imagick's performance so drastically? Or know any fixes for this? Below is the test script I’m using (it is quite slower on a number of other functions not just distorts):
<?php
$startTime = microtime(true);
// Get script directory
$script_path = dirname(__FILE__) . "/";
$controlPoints = [
1.5,
0, 0, 355, 70,
0, 3708, 337, 974,
1380, 0, 657, 105,
1380, 3708, 654, 956,
];
echo "Doing Distortion 1\n";
$design = new Imagick($script_path . 'input.png');
// Apply distortion
try {
$design->distortImage(Imagick::DISTORTION_POLYNOMIAL, $controlPoints, true);
} catch (Exception $e) {
echo "Error applying distortion: " . $e->getMessage() . "\n";
}
// Write the distorted image to an output file
$design->writeImage($script_path . "testoutput.png");
$endTime = microtime(true);
$executionTime = ($endTime - $startTime);
echo "Execution Time: " . $executionTime . " seconds\n";
Metadata
Metadata
Assignees
Labels
No labels