File: bench.pl

package info (click to toggle)
libtry-tiny-perl 0.32-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: perl: 323; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env perl

use warnings;
use strict;

use Benchmark::Dumb ':all';
use Try::Tiny;

my $max = 10_000;

cmpthese('0.003', {
  eval => sub { do { local $@; eval { die 'foo' } } for (1..$max) },
  try => sub { do { try { die 'foo' } } for (1..$max) },
});