File: get_stash_bench.pl

package info (click to toggle)
libdata-util-perl 0.67-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 556 kB
  • sloc: perl: 2,958; ansic: 416; makefile: 8
file content (24 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!perl -w

use strict;

use Benchmark qw(:all);

use FindBin qw($Bin);
use lib $Bin;
use Common;

use Data::Util qw(:all);

signeture 'Data::Util' => \&get_stash;

my $pkg = 'Data::Util';

cmpthese timethese -1 => {
	get_stash => sub{
		my $stash = get_stash($pkg);
	},
	direct => sub{
		my $stash = do{ no strict 'refs'; \%{$pkg . '::'}; };
	},
};