use warnings; use Benchmark; use Math::GMP; no warnings 'once'; $str1 = '123456789' x 1000; $gmp1 = Math::GMP->new($str1); timethese(100000, { 'Math::GMP 1' => '$ret1 = $gmp1 >> 1000;', 'Math::GMP 2' => '$ret2 = $gmp1->div_2exp_gmp(1000)', }); print "gmp calculation ok\n" if $ret1 == $ret2; __END__ Outputs: Benchmark: timing 100000 iterations of Math::GMP 1, Math::GMP 2... Math::GMP 1: 0 wallclock secs ( 0.19 usr + 0.00 sys = 0.19 CPU) @ 534759.36/s (n=100000) (warning: too few iterations for a reliable count) Math::GMP 2: 0 wallclock secs ( 0.12 usr + 0.00 sys = 0.12 CPU) @ 800000.00/s (n=100000) (warning: too few iterations for a reliable count) gmp calculation ok