Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (24 sloc) 0.55 kB
#!perl -w
use Imager;
use Benchmark;
$img = Imager->new();
$img->open(file=>'testimg/penguin-base.jpg', type=>'jpeg')
|| die "Cannot open penguin-base.jpg";
timethese(-10,
{ old=><<'EOS',
$im2 = $img->transform(xexpr=>'x', yexpr=>'y+10*sin((x+y)/10)');
EOS
new=><<'EOS'
$im2 = Imager::transform2({rpnexpr=>'x y 10 x y + 10 / sin * + getp1'}, $img);
EOS
}
);
timethese(-10,
{ old=><<'EOS',
$im2 = $img->transform(xexpr=>'x', yexpr=>'y+(x+y)/10');
EOS
new=><<'EOS'
$im2 = Imager::transform2({rpnexpr=>'x y x y + 10 / + getp1'}, $img);
EOS
}
);
Jump to Line
Something went wrong with that request. Please try again.