Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Scalar/Util.pm |
Statements | Executed 15 statements in 297µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
8979 | 26 | 22 | 5.12ms | 5.12ms | blessed (xsub) | Scalar::Util::
1265 | 18 | 12 | 567µs | 567µs | weaken (xsub) | Scalar::Util::
702 | 5 | 4 | 226µs | 226µs | reftype (xsub) | Scalar::Util::
66 | 1 | 1 | 29µs | 29µs | isweak (xsub) | Scalar::Util::
44 | 2 | 2 | 11µs | 11µs | refaddr (xsub) | Scalar::Util::
1 | 1 | 1 | 8µs | 10µs | BEGIN@9 | Scalar::Util::
1 | 1 | 1 | 5µs | 8µs | BEGIN@10 | Scalar::Util::
0 | 0 | 0 | 0s | 0s | export_fail | Scalar::Util::
0 | 0 | 0 | 0s | 0s | set_prototype | Scalar::Util::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # Copyright (c) 1997-2007 Graham Barr <gbarr@pobox.com>. All rights reserved. | ||||
2 | # This program is free software; you can redistribute it and/or | ||||
3 | # modify it under the same terms as Perl itself. | ||||
4 | # | ||||
5 | # Maintained since 2013 by Paul Evans <leonerd@leonerd.org.uk> | ||||
6 | |||||
7 | package Scalar::Util; | ||||
8 | |||||
9 | 2 | 14µs | 2 | 11µs | # spent 10µs (8+1) within Scalar::Util::BEGIN@9 which was called:
# once (8µs+1µs) by BenchmarkAnything::Storage::Frontend::Lib::BEGIN@10 at line 9 # spent 10µs making 1 call to Scalar::Util::BEGIN@9
# spent 1µs making 1 call to strict::import |
10 | 2 | 197µs | 2 | 10µs | # spent 8µs (5+2) within Scalar::Util::BEGIN@10 which was called:
# once (5µs+2µs) by BenchmarkAnything::Storage::Frontend::Lib::BEGIN@10 at line 10 # spent 8µs making 1 call to Scalar::Util::BEGIN@10
# spent 2µs making 1 call to warnings::import |
11 | 1 | 400ns | require Exporter; | ||
12 | |||||
13 | 1 | 6µs | our @ISA = qw(Exporter); | ||
14 | 1 | 1µs | our @EXPORT_OK = qw( | ||
15 | blessed refaddr reftype weaken unweaken isweak | ||||
16 | |||||
17 | dualvar isdual isvstring looks_like_number openhandle readonly set_prototype | ||||
18 | tainted | ||||
19 | ); | ||||
20 | 1 | 200ns | our $VERSION = "1.47"; | ||
21 | 1 | 10µs | $VERSION = eval $VERSION; # spent 2µs executing statements in string eval | ||
22 | |||||
23 | 1 | 48µs | require List::Util; # List::Util loads the XS | ||
24 | 1 | 14µs | 1 | 7µs | List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863) # spent 7µs making 1 call to UNIVERSAL::VERSION |
25 | |||||
26 | our @EXPORT_FAIL; | ||||
27 | |||||
28 | 1 | 500ns | unless (defined &weaken) { | ||
29 | push @EXPORT_FAIL, qw(weaken); | ||||
30 | } | ||||
31 | 1 | 100ns | unless (defined &isweak) { | ||
32 | push @EXPORT_FAIL, qw(isweak isvstring); | ||||
33 | } | ||||
34 | 1 | 100ns | unless (defined &isvstring) { | ||
35 | push @EXPORT_FAIL, qw(isvstring); | ||||
36 | } | ||||
37 | |||||
38 | sub export_fail { | ||||
39 | if (grep { /^(?:weaken|isweak)$/ } @_ ) { | ||||
40 | require Carp; | ||||
41 | Carp::croak("Weak references are not implemented in the version of perl"); | ||||
42 | } | ||||
43 | |||||
44 | if (grep { /^isvstring$/ } @_ ) { | ||||
45 | require Carp; | ||||
46 | Carp::croak("Vstrings are not implemented in the version of perl"); | ||||
47 | } | ||||
48 | |||||
49 | @_; | ||||
50 | } | ||||
51 | |||||
52 | # set_prototype has been moved to Sub::Util with a different interface | ||||
53 | sub set_prototype(&$) | ||||
54 | { | ||||
55 | my ( $code, $proto ) = @_; | ||||
56 | return Sub::Util::set_prototype( $proto, $code ); | ||||
57 | } | ||||
58 | |||||
59 | 1 | 6µs | 1; | ||
60 | |||||
61 | __END__ | ||||
# spent 5.12ms within Scalar::Util::blessed which was called 8979 times, avg 570ns/call:
# 7008 times (4.39ms+0s) by Search::Elasticsearch::Util::load_plugin at line 50 of Search/Elasticsearch/Util.pm, avg 626ns/call
# 401 times (152µs+0s) by Class::MOP::Mixin::HasMethods::add_method at line 54 of Class/MOP/Mixin/HasMethods.pm, avg 380ns/call
# 205 times (50µs+0s) by Class::MOP::Method::wrap at line 30 of Class/MOP/Method.pm, avg 244ns/call
# 195 times (88µs+0s) by Class::MOP::Mixin::meta or Class::MOP::Object::meta or DBIx::MultiStatementDo::meta or Moose::Meta::Role::Application::RoleSummation::meta or Moose::Meta::Role::Application::ToClass::meta or Moose::Meta::Role::Application::ToInstance::meta or Moose::Meta::Role::Application::ToRole::meta or Moose::Meta::Role::Application::meta or Moose::Meta::Role::Composite::meta or Moose::Meta::Role::Method::Required::meta or Moose::Meta::Role::meta or Moose::Meta::TypeCoercion::Union::meta or Moose::Meta::TypeCoercion::meta or Moose::Meta::TypeConstraint::Class::meta or Moose::Meta::TypeConstraint::DuckType::meta or Moose::Meta::TypeConstraint::Enum::meta or Moose::Meta::TypeConstraint::Parameterizable::meta or Moose::Meta::TypeConstraint::Parameterized::meta or Moose::Meta::TypeConstraint::Registry::meta or Moose::Meta::TypeConstraint::Role::meta or Moose::Meta::TypeConstraint::Union::meta or Moose::Meta::TypeConstraint::meta at line 42 of Class/MOP/Method/Meta.pm, avg 452ns/call
# 193 times (92µs+0s) by Class::MOP::Method::Accessor::new at line 26 of Class/MOP/Method/Accessor.pm, avg 475ns/call
# 155 times (55µs+0s) by Class::MOP::Mixin::HasMethods::get_method at line 114 of Class/MOP/Mixin/HasMethods.pm, avg 355ns/call
# 135 times (44µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 14 of Class/MOP/Mixin/HasAttributes.pm, avg 327ns/call
# 135 times (44µs+0s) by Class::MOP::Attribute::attach_to_class at line 252 of Class/MOP/Attribute.pm, avg 327ns/call
# 107 times (30µs+0s) by Moose::Util::TypeConstraints::find_type_constraint at line 298 of Moose/Util/TypeConstraints.pm, avg 279ns/call
# 63 times (14µs+0s) by Moose::Meta::Attribute::_new or Moose::Meta::Instance::_new or Moose::Meta::Method::_new or Moose::Meta::TypeConstraint::Class::_new or Moose::Meta::TypeConstraint::Parameterizable::_new or Moose::Meta::TypeConstraint::Parameterized::_new or Moose::Meta::TypeConstraint::Role::_new or Moose::Meta::TypeConstraint::_new at line 6 of (eval 33)[Eval/Closure.pm:142], avg 216ns/call
# 59 times (19µs+0s) by Class::MOP::Mixin::meta at line 12 of Class/MOP/Mixin.pm, avg 320ns/call
# 52 times (15µs+0s) by Class::MOP::Instance::BUILDARGS at line 17 of Class/MOP/Instance.pm, avg 288ns/call
# 50 times (35µs+0s) by Moose::Meta::TypeConstraint::Registry::add_type_constraint at line 47 of Moose/Meta/TypeConstraint/Registry.pm, avg 692ns/call
# 47 times (18µs+0s) by Class::MOP::class_of at line 57 of Class/MOP.pm, avg 372ns/call
# 43 times (13µs+0s) by Class::MOP::Method::Wrapped::wrap at line 70 of Class/MOP/Method/Wrapped.pm, avg 307ns/call
# 35 times (25µs+0s) by Class::MOP::Class::_construct_instance at line 508 of Class/MOP/Class.pm, avg 726ns/call
# 30 times (15µs+0s) by Class::MOP::Method::Constructor::new at line 20 of Class/MOP/Method/Constructor.pm, avg 503ns/call
# 26 times (10µs+0s) by Class::MOP::Method::clone at line 138 of Class/MOP/Method.pm, avg 373ns/call
# 16 times (4µs+0s) by Moose::Util::TypeConstraints::_create_type_constraint at line 572 of Moose/Util/TypeConstraints.pm, avg 256ns/call
# 8 times (2µs+0s) by Moose::Meta::Attribute::_process_isa_option at line 333 of Moose/Meta/Attribute.pm, avg 188ns/call
# 5 times (2µs+0s) by Method::Generate::Accessor::_generate_call_code at line 464 of Method/Generate/Accessor.pm, avg 380ns/call
# 4 times (1µs+0s) by Moose::Meta::Class::add_attribute at line 569 of Moose/Meta/Class.pm, avg 250ns/call
# 2 times (1µs+0s) by Moose::Meta::TypeConstraint::Parameterized::compile_type_constraint at line 50 of Moose/Meta/TypeConstraint/Parameterized.pm, avg 600ns/call
# 2 times (1µs+0s) by Moose::Meta::Method::Delegation::new at line 24 of Moose/Meta/Method/Delegation.pm, avg 500ns/call
# 2 times (400ns+0s) by Moose::Meta::Method::Delegation::_get_delegate_accessor at line 131 of Moose/Meta/Method/Delegation.pm, avg 200ns/call
# once (600ns+0s) by Moose::Meta::Method::Destructor::is_needed at line 61 of Moose/Meta/Method/Destructor.pm | |||||
# spent 29µs within Scalar::Util::isweak which was called 66 times, avg 436ns/call:
# 66 times (29µs+0s) by Class::MOP::metaclass_is_weak at line 50 of Class/MOP.pm, avg 436ns/call | |||||
# spent 11µs within Scalar::Util::refaddr which was called 44 times, avg 241ns/call:
# 42 times (10µs+0s) by Moose::Meta::TypeConstraint::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Meta/TypeConstraint.pm:8] at line 8 of Moose/Meta/TypeConstraint.pm, avg 243ns/call
# 2 times (400ns+0s) by Class::MOP::Method::Inlined::can_be_inlined at line 68 of Class/MOP/Method/Inlined.pm, avg 200ns/call | |||||
# spent 226µs within Scalar::Util::reftype which was called 702 times, avg 322ns/call:
# 208 times (66µs+0s) by Eval::Closure::_validate_env at line 78 of Eval/Closure.pm, avg 316ns/call
# 205 times (55µs+0s) by Class::MOP::Method::wrap at line 30 of Class/MOP/Method.pm, avg 268ns/call
# 131 times (45µs+0s) by Eval::Closure::_canonicalize_source at line 54 of Eval/Closure.pm, avg 347ns/call
# 91 times (42µs+0s) by Sub::Install::_CODELIKE at line 84 of Sub/Install.pm, avg 465ns/call
# 67 times (18µs+0s) by Class::MOP::Mixin::HasMethods::wrap_method_body at line 37 of Class/MOP/Mixin/HasMethods.pm, avg 261ns/call | |||||
# spent 567µs within Scalar::Util::weaken which was called 1265 times, avg 448ns/call:
# 378 times (142µs+0s) by Class::MOP::Method::attach_to_class at line 80 of Class/MOP/Method.pm, avg 375ns/call
# 193 times (105µs+0s) by Class::MOP::Method::Accessor::new at line 41 of Class/MOP/Method/Accessor.pm, avg 546ns/call
# 162 times (84µs+0s) by Class::MOP::Method::wrap at line 51 of Class/MOP/Method.pm, avg 519ns/call
# 135 times (66µs+0s) by Class::MOP::Attribute::attach_to_class at line 256 of Class/MOP/Attribute.pm, avg 489ns/call
# 55 times (28µs+0s) by Sub::Defer::defer_sub at line 67 of Sub/Defer.pm, avg 515ns/call
# 55 times (11µs+0s) by Sub::Defer::defer_sub at line 68 of Sub/Defer.pm, avg 200ns/call
# 52 times (31µs+0s) by Class::MOP::Instance::new at line 41 of Class/MOP/Instance.pm, avg 596ns/call
# 44 times (17µs+0s) by Sub::Quote::quote_sub at line 100 of Sub/Quote.pm, avg 377ns/call
# 44 times (13µs+0s) by Sub::Quote::quote_sub at line 101 of Sub/Quote.pm, avg 300ns/call
# 44 times (10µs+0s) by Sub::Quote::quote_sub at line 102 of Sub/Quote.pm, avg 223ns/call
# 30 times (16µs+0s) by Class::MOP::Method::Constructor::new at line 32 of Class/MOP/Method/Constructor.pm, avg 550ns/call
# 26 times (9µs+0s) by Class::MOP::Method::clone at line 139 of Class/MOP/Method.pm, avg 346ns/call
# 25 times (13µs+0s) by Class::MOP::Method::Meta::_generate_meta_method at line 23 of Class/MOP/Method/Meta.pm, avg 528ns/call
# 17 times (18µs+0s) by Sub::Quote::unquote_sub at line 161 of Sub/Quote.pm, avg 1µs/call
# 2 times (700ns+0s) by Moose::Meta::Method::Delegation::new at line 51 of Moose/Meta/Method/Delegation.pm, avg 350ns/call
# once (2µs+0s) by BenchmarkAnything::Storage::Frontend::Lib::connect at line 310 of DBI.pm
# once (800ns+0s) by Moose::Meta::Method::Constructor::new at line 43 of Moose/Meta/Method/Constructor.pm
# once (400ns+0s) by Moose::Meta::Method::Destructor::new at line 44 of Moose/Meta/Method/Destructor.pm |