| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/darwin-2level/List/MoreUtils/XS.pm |
| Statements | Executed 16 statements in 372µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 861µs | 3.49ms | List::MoreUtils::XS::BEGIN@10 |
| 1 | 1 | 1 | 15µs | 15µs | List::MoreUtils::XS::BEGIN@3 |
| 1 | 1 | 1 | 10µs | 40µs | List::MoreUtils::XS::BEGIN@7 |
| 1 | 1 | 1 | 7µs | 11µs | List::MoreUtils::XS::BEGIN@5 |
| 1 | 1 | 1 | 6µs | 18µs | List::MoreUtils::XS::BEGIN@4 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package List::MoreUtils::XS; | ||||
| 2 | |||||
| 3 | 2 | 43µs | 1 | 15µs | # spent 15µs within List::MoreUtils::XS::BEGIN@3 which was called:
# once (15µs+0s) by List::MoreUtils::BEGIN@13 at line 3 # spent 15µs making 1 call to List::MoreUtils::XS::BEGIN@3 |
| 4 | 2 | 19µs | 2 | 29µs | # spent 18µs (6+11) within List::MoreUtils::XS::BEGIN@4 which was called:
# once (6µs+11µs) by List::MoreUtils::BEGIN@13 at line 4 # spent 18µs making 1 call to List::MoreUtils::XS::BEGIN@4
# spent 11µs making 1 call to strict::import |
| 5 | 2 | 21µs | 2 | 15µs | # spent 11µs (7+4) within List::MoreUtils::XS::BEGIN@5 which was called:
# once (7µs+4µs) by List::MoreUtils::BEGIN@13 at line 5 # spent 11µs making 1 call to List::MoreUtils::XS::BEGIN@5
# spent 4µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 124µs | 2 | 71µs | # spent 40µs (10+31) within List::MoreUtils::XS::BEGIN@7 which was called:
# once (10µs+31µs) by List::MoreUtils::BEGIN@13 at line 7 # spent 40µs making 1 call to List::MoreUtils::XS::BEGIN@7
# spent 31µs making 1 call to vars::import |
| 8 | |||||
| 9 | BEGIN | ||||
| 10 | # spent 3.49ms (861µs+2.62) within List::MoreUtils::XS::BEGIN@10 which was called:
# once (861µs+2.62ms) by List::MoreUtils::BEGIN@13 at line 42 | ||||
| 11 | 1 | 500ns | $VERSION = '0.408'; | ||
| 12 | |||||
| 13 | # Load the XS at compile-time so that redefinition warnings will be | ||||
| 14 | # thrown correctly if the XS versions of part or indexes loaded | ||||
| 15 | 1 | 900ns | my $ldr = <<EOLDR; | ||
| 16 | package List::MoreUtils; | ||||
| 17 | |||||
| 18 | # PERL_DL_NONLAZY must be false, or any errors in loading will just | ||||
| 19 | # cause the perl code to be tested | ||||
| 20 | local \$ENV{PERL_DL_NONLAZY} = 0 if \$ENV{PERL_DL_NONLAZY}; | ||||
| 21 | |||||
| 22 | use XSLoader (); | ||||
| 23 | XSLoader::load("List::MoreUtils", "$VERSION"); | ||||
| 24 | |||||
| 25 | 1; | ||||
| 26 | EOLDR | ||||
| 27 | |||||
| 28 | 1 | 41µs | eval $ldr unless $ENV{LIST_MOREUTILS_PP}; # spent 116µs executing statements in string eval # includes 8µs spent executing 1 call to 1 sub defined therein. | ||
| 29 | |||||
| 30 | # ensure to catch even PP only subs | ||||
| 31 | 1 | 25µs | my @pp_imp = map { "List::MoreUtils->can(\"$_\") or *$_ = \\&List::MoreUtils::PP::$_;" } | ||
| 32 | qw(any all none notall one any_u all_u none_u notall_u one_u true false | ||||
| 33 | firstidx firstval firstres lastidx lastval lastres onlyidx onlyval onlyres | ||||
| 34 | insert_after insert_after_string | ||||
| 35 | apply after after_incl before before_incl | ||||
| 36 | each_array each_arrayref pairwise | ||||
| 37 | natatime mesh uniq singleton minmax part indexes bsearch bsearchidx | ||||
| 38 | sort_by nsort_by _XScompiled); | ||||
| 39 | 1 | 8µs | my $pp_stuff = join( "\n", "use List::MoreUtils::PP;", "package List::MoreUtils;", @pp_imp ); | ||
| 40 | 1 | 44µs | eval $pp_stuff; # spent 793µs executing statements in string eval # includes 2.05ms spent executing 1 call to 1 sub defined therein. | ||
| 41 | 1 | 8µs | die $@ if $@; | ||
| 42 | 1 | 37µs | 1 | 3.49ms | } # spent 3.49ms making 1 call to List::MoreUtils::XS::BEGIN@10 |
| 43 | |||||
| 44 | =pod | ||||
| 45 | |||||
| 46 | =head1 NAME | ||||
| 47 | |||||
| 48 | List::MoreUtils::XS - Provide compiled List::MoreUtils functions | ||||
| 49 | |||||
| 50 | =head1 SYNOPSIS | ||||
| 51 | |||||
| 52 | BEGIN { delete $ENV{LIST_MOREUTILS_PP}; } | ||||
| 53 | use List::MoreUtils ...; | ||||
| 54 | |||||
| 55 | =head1 SEE ALSO | ||||
| 56 | |||||
| 57 | L<List::Util>, L<List::AllUtils> | ||||
| 58 | |||||
| 59 | =head1 AUTHOR | ||||
| 60 | |||||
| 61 | Jens Rehsack E<lt>rehsack AT cpan.orgE<gt> | ||||
| 62 | |||||
| 63 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||||
| 64 | |||||
| 65 | Tassilo von Parseval E<lt>tassilo.von.parseval@rwth-aachen.deE<gt> | ||||
| 66 | |||||
| 67 | =head1 COPYRIGHT AND LICENSE | ||||
| 68 | |||||
| 69 | Some parts copyright 2011 Aaron Crane. | ||||
| 70 | |||||
| 71 | Copyright 2004 - 2010 by Tassilo von Parseval | ||||
| 72 | |||||
| 73 | Copyright 2013 - 2015 by Jens Rehsack | ||||
| 74 | |||||
| 75 | This library is free software; you can redistribute it and/or modify | ||||
| 76 | it under the same terms as Perl itself, either Perl version 5.8.4 or, | ||||
| 77 | at your option, any later version of Perl 5 you may have available. | ||||
| 78 | |||||
| 79 | =cut | ||||
| 80 | |||||
| 81 | 1 | 2µs | 1; |