add new comparison method rgb_difference that resembles arithmetical difference per...
[imager.git] / bench / transbench.perl
CommitLineData
02d1d628
AMH
1#!perl -w
2use Imager;
3use Benchmark;
4
5$img = Imager->new();
6$img->open(file=>'testimg/penguin-base.jpg', type=>'jpeg')
7 || die "Cannot open penguin-base.jpg";
8
9timethese(-10,
10 { old=><<'EOS',
11$im2 = $img->transform(xexpr=>'x', yexpr=>'y+10*sin((x+y)/10)');
12EOS
13 new=><<'EOS'
14$im2 = Imager::transform2({rpnexpr=>'x y 10 x y + 10 / sin * + getp1'}, $img);
15EOS
16}
17);
18timethese(-10,
19 { old=><<'EOS',
20$im2 = $img->transform(xexpr=>'x', yexpr=>'y+(x+y)/10');
21EOS
22 new=><<'EOS'
23$im2 = Imager::transform2({rpnexpr=>'x y x y + 10 / + getp1'}, $img);
24EOS
25}
26);
27