| Filename | /usr/lib/x86_64-linux-gnu/perl-base/lib.pm | 
| Statements | Executed 47 statements in 366µs | 
| Calls | P | F | Exclusive Time  | 
        Inclusive Time  | 
        Subroutine | 
|---|---|---|---|---|---|
| 1 | 1 | 1 | 26µs | 44µs | lib::import | 
| 8 | 4 | 1 | 10µs | 10µs | lib::CORE:ftdir (opcode) | 
| 1 | 1 | 1 | 10µs | 16µs | lib::BEGIN@6 | 
| 2 | 1 | 1 | 4µs | 4µs | lib::CORE:ftis (opcode) | 
| 1 | 1 | 1 | 4µs | 6µs | lib::BEGIN@8 | 
| 2 | 1 | 1 | 4µs | 4µs | lib::_get_dirs | 
| 2 | 1 | 1 | 500ns | 500ns | lib::CORE:match (opcode) | 
| 0 | 0 | 0 | 0s | 0s | lib::unimport | 
| Line | State ments  | 
      Time on line  | 
      Calls | Time in subs  | 
      Code | 
|---|---|---|---|---|---|
| 1 | package lib; | ||||
| 2 | |||||
| 3 | # THIS FILE IS AUTOMATICALLY GENERATED FROM lib_pm.PL. | ||||
| 4 | # ANY CHANGES TO THIS FILE WILL BE OVERWRITTEN BY THE NEXT PERL BUILD. | ||||
| 5 | |||||
| 6 | 2 | 17µs | 2 | 23µs | # spent 16µs (10+7) within lib::BEGIN@6 which was called:
#    once (10µs+7µs) by main::BEGIN@35 at line 6 # spent    16µs making 1 call to lib::BEGIN@6
# spent     7µs making 1 call to Config::import  | 
| 7 | |||||
| 8 | 2 | 290µs | 2 | 8µs | # spent 6µs (4+2) within lib::BEGIN@8 which was called:
#    once (4µs+2µs) by main::BEGIN@35 at line 8 # spent     6µs making 1 call to lib::BEGIN@8
# spent     2µs making 1 call to strict::import  | 
| 9 | |||||
| 10 | 1 | 4µs | 1 | 3µs | my $archname         = $Config{archname}; # spent     3µs making 1 call to Config::FETCH  | 
| 11 | 1 | 1µs | 1 | 900ns | my $version          = $Config{version}; # spent   900ns making 1 call to Config::FETCH  | 
| 12 | 1 | 2µs | 1 | 700ns | my @inc_version_list = reverse split / /, $Config{inc_version_list}; # spent   700ns making 1 call to Config::FETCH  | 
| 13 | |||||
| 14 | 1 | 1µs | our @ORIG_INC = @INC; # take a handy copy of 'original' value | ||
| 15 | 1 | 200ns | our $VERSION = '0.65'; | ||
| 16 | |||||
| 17 | # spent 44µs (26+18) within lib::import which was called:
#    once (26µs+18µs) by main::BEGIN@35 at line 36 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/bin/split.pl  | ||||
| 18 | 1 | 100ns | shift; | ||
| 19 | |||||
| 20 | 1 | 100ns | my %names; | ||
| 21 | 1 | 300ns | foreach (reverse @_) { | ||
| 22 | 2 | 300ns | my $path = $_; # we'll be modifying it, so break the alias | ||
| 23 | 2 | 200ns | if ($path eq '') { | ||
| 24 | require Carp; | ||||
| 25 | Carp::carp("Empty compile time value given to use lib"); | ||||
| 26 | } | ||||
| 27 | |||||
| 28 | 2 | 11µs | 6 | 5µs |         if ($path !~ /\.par$/i && -e $path && ! -d _) {         # spent     4µs making 2 calls to lib::CORE:ftis, avg 2µs/call
        # spent   500ns making 2 calls to lib::CORE:match, avg 250ns/call
        # spent   200ns making 2 calls to lib::CORE:ftdir, avg 100ns/call  | 
| 29 | require Carp; | ||||
| 30 | Carp::carp("Parameter to use lib must be directory, not file"); | ||||
| 31 | } | ||||
| 32 | 2 | 1µs | unshift(@INC, $path); | ||
| 33 | # Add any previous version directories we found at configure time | ||||
| 34 | 2 | 500ns | foreach my $incver (@inc_version_list) | ||
| 35 | { | ||||
| 36 | my $dir = "$path/$incver"; | ||||
| 37 | unshift(@INC, $dir) if -d $dir; | ||||
| 38 | } | ||||
| 39 | # Put a corresponding archlib directory in front of $path if it | ||||
| 40 | # looks like $path has an archlib directory below it. | ||||
| 41 | 2 | 2µs | 2 | 4µs |         my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)         # spent     4µs making 2 calls to lib::_get_dirs, avg 2µs/call  | 
| 42 | = _get_dirs($path); | ||||
| 43 | 2 | 5µs | 2 | 4µs |         unshift(@INC, $arch_dir)         if -d $arch_auto_dir;         # spent     4µs making 2 calls to lib::CORE:ftdir, avg 2µs/call  | 
| 44 | 2 | 5µs | 2 | 3µs |         unshift(@INC, $version_dir)      if -d $version_dir;         # spent     3µs making 2 calls to lib::CORE:ftdir, avg 2µs/call  | 
| 45 | 2 | 5µs | 2 | 3µs |         unshift(@INC, $version_arch_dir) if -d $version_arch_dir;         # spent     3µs making 2 calls to lib::CORE:ftdir, avg 1µs/call  | 
| 46 | } | ||||
| 47 | |||||
| 48 | # remove trailing duplicates | ||||
| 49 | 1 | 7µs | @INC = grep { ++$names{$_} == 1 } @INC; | ||
| 50 | 1 | 2µs | return; | ||
| 51 | } | ||||
| 52 | |||||
| 53 | sub unimport { | ||||
| 54 | shift; | ||||
| 55 | |||||
| 56 | my %names; | ||||
| 57 | foreach my $path (@_) { | ||||
| 58 | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) | ||||
| 59 | = _get_dirs($path); | ||||
| 60 | ++$names{$path}; | ||||
| 61 | ++$names{$arch_dir} if -d $arch_auto_dir; | ||||
| 62 | ++$names{$version_dir} if -d $version_dir; | ||||
| 63 | ++$names{$version_arch_dir} if -d $version_arch_dir; | ||||
| 64 | } | ||||
| 65 | |||||
| 66 | # Remove ALL instances of each named directory. | ||||
| 67 | @INC = grep { !exists $names{$_} } @INC; | ||||
| 68 | return; | ||||
| 69 | } | ||||
| 70 | |||||
| 71 | # spent 4µs within lib::_get_dirs which was called 2 times, avg 2µs/call:
# 2 times (4µs+0s) by lib::import at line 41, avg 2µs/call  | ||||
| 72 | 2 | 300ns | my($dir) = @_; | ||
| 73 | 2 | 200ns | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
| 74 | |||||
| 75 | 2 | 600ns | $arch_auto_dir = "$dir/$archname/auto"; | ||
| 76 | 2 | 500ns | $arch_dir = "$dir/$archname"; | ||
| 77 | 2 | 400ns | $version_dir = "$dir/$version"; | ||
| 78 | 2 | 400ns | $version_arch_dir = "$dir/$version/$archname"; | ||
| 79 | |||||
| 80 | 2 | 3µs | return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
| 81 | } | ||||
| 82 | |||||
| 83 | 1 | 5µs | 1; | ||
| 84 | __END__ | ||||
# spent 10µs within lib::CORE:ftdir which was called 8 times, avg 1µs/call:
# 2 times (4µs+0s) by lib::import at line 43, avg 2µs/call
# 2 times (3µs+0s) by lib::import at line 44, avg 2µs/call
# 2 times (3µs+0s) by lib::import at line 45, avg 1µs/call
# 2 times (200ns+0s) by lib::import at line 28, avg 100ns/call  | |||||
# spent 4µs within lib::CORE:ftis which was called 2 times, avg 2µs/call:
# 2 times (4µs+0s) by lib::import at line 28, avg 2µs/call  | |||||
# spent 500ns within lib::CORE:match which was called 2 times, avg 250ns/call:
# 2 times (500ns+0s) by lib::import at line 28, avg 250ns/call  |