← Index
NYTProf Performance Profile   « line view »
For bin/benchmark-perlformance
  Run on Fri Apr 17 15:31:48 2015
Reported on Fri Apr 17 15:32:02 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Devel/Platform/Info.pm
StatementsExecuted 9 statements in 232µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11110µs20µsDevel::Platform::Info::::BEGIN@3Devel::Platform::Info::BEGIN@3
1118µs12µsDevel::Platform::Info::::BEGIN@4Devel::Platform::Info::BEGIN@4
1118µs30µsDevel::Platform::Info::::BEGIN@6Devel::Platform::Info::BEGIN@6
0000s0sDevel::Platform::Info::::get_infoDevel::Platform::Info::get_info
0000s0sDevel::Platform::Info::::newDevel::Platform::Info::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Devel::Platform::Info;
2
3219µs230µs
# spent 20µs (10+10) within Devel::Platform::Info::BEGIN@3 which was called: # once (10µs+10µs) by Benchmark::Perl::Formance::BEGIN@15 at line 3
use strict;
# spent 20µs making 1 call to Devel::Platform::Info::BEGIN@3 # spent 10µs making 1 call to strict::import
4219µs217µs
# spent 12µs (8+5) within Devel::Platform::Info::BEGIN@4 which was called: # once (8µs+5µs) by Benchmark::Perl::Formance::BEGIN@15 at line 4
use warnings;
# spent 12µs making 1 call to Devel::Platform::Info::BEGIN@4 # spent 4µs making 1 call to warnings::import
5
62172µs252µs
# spent 30µs (8+22) within Devel::Platform::Info::BEGIN@6 which was called: # once (8µs+22µs) by Benchmark::Perl::Formance::BEGIN@15 at line 6
use vars qw($VERSION);
# spent 30µs making 1 call to Devel::Platform::Info::BEGIN@6 # spent 22µs making 1 call to vars::import
71600ns$VERSION = '0.11';
8
9#----------------------------------------------------------------------------
10
11115µsmy %map = (
12 # Unix (and like) family OSes
13 'freebsd' => 'BSD',
14 'openbsd' => 'BSD',
15 'netbsd' => 'BSD',
16 'mirbsd' => 'BSD',
17 'dragonfly' => 'BSD',
18 'midnightbsd' => 'BSD',
19
20 'irix' => 'Irix',
21
22 'linux' => 'Linux',
23 'aix' => 'Linux',
24 'bsdos' => 'Linux',
25 'dgux' => 'Linux',
26 'dynixptx' => 'Linux',
27 'hpux' => 'Linux',
28 'dec_osf' => 'Linux',
29 'svr4' => 'Linux',
30 'unicos' => 'Linux',
31 'unicosmk' => 'Linux',
32 'ultrix' => 'Linux',
33
34 'sco_sv' => 'SCO',
35 'sco3' => 'SCO',
36 'sco' => 'SCO',
37
38 'solaris' => 'Solaris',
39 'sunos' => 'Solaris',
40
41 # Windows family OSes
42 'dos' => 'Win32',
43 'os2' => 'Win32',
44 'mswin32' => 'Win32',
45 'netware' => 'Win32',
46 'cygwin' => 'Win32',
47
48 # Mac family OSes
49 'macos' => 'Mac',
50 'rhapsody' => 'Mac',
51 'darwin' => 'Mac',
52
53 # Other OSes
54 'vms' => 'Linux',
55 'vos' => 'Linux',
56 'os390' => 'Linux',
57 'vmesa' => 'Linux',
58 'riscos' => 'Linux',
59 'amigaos' => 'Linux',
60 'beos' => 'Linux',
61 'machten' => 'Linux',
62 'mpeix' => 'Linux',
63);
64
65#----------------------------------------------------------------------------
66
67sub new {
68 my ($class) = @_;
69 my $self = {};
70 bless $self, $class;
71 return $self;
72}
73
74sub get_info {
75 my $self = shift;
76 my $data;
77
78 my $plugin = $map{ lc $^O } || 'Linux';
79
80 my $driver = 'Devel::Platform::Info::' . $plugin;
81 my $require = "$driver.pm";
82 $require =~ s!::!/!g;
83
84 eval {
85 require $require;
86 $self->{driver} = $driver->new();
87 $data = $self->{driver}->get_info();
88 };
89
90 return if($@);
91 return $data;
92}
93
9416µs1;
95
96__END__