← Index
NYTProf Performance Profile   « line view »
For split.pl
  Run on Thu Apr 20 02:05:47 2023
Reported on Thu Apr 20 18:31:10 2023

Filename/home/hejohns/documentsNoSync/22f/490/gradescope-utils/lib/Gradescope/Translate.pm
StatementsExecuted 455 statements in 3.46ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
105113.13ms53715sGradescope::Translate::::read_csvGradescope::Translate::read_csv
11112µs464µsGradescope::Translate::::BEGIN@4Gradescope::Translate::BEGIN@4
11111µs11µsGradescope::Translate::::BEGIN@2Gradescope::Translate::BEGIN@2
1117µs30µsGradescope::Translate::::BEGIN@15Gradescope::Translate::BEGIN@15
1116µs11µsGradescope::Translate::::BEGIN@17Gradescope::Translate::BEGIN@17
1115µs26µsGradescope::Translate::::BEGIN@19Gradescope::Translate::BEGIN@19
1115µs72µsGradescope::Translate::::BEGIN@16Gradescope::Translate::BEGIN@16
1115µs16µsGradescope::Translate::::BEGIN@21Gradescope::Translate::BEGIN@21
1114µs10µsGradescope::Translate::::BEGIN@10Gradescope::Translate::BEGIN@10
1114µs6µsGradescope::Translate::::BEGIN@3Gradescope::Translate::BEGIN@3
1114µs31µsGradescope::Translate::::BEGIN@5Gradescope::Translate::BEGIN@5
1114µs41µsGradescope::Translate::::BEGIN@12Gradescope::Translate::BEGIN@12
1114µs55µsGradescope::Translate::::BEGIN@18Gradescope::Translate::BEGIN@18
1114µs8µsGradescope::Translate::::BEGIN@7Gradescope::Translate::BEGIN@7
1113µs9µsGradescope::Translate::::BEGIN@11Gradescope::Translate::BEGIN@11
1113µs9µsGradescope::Translate::::BEGIN@13Gradescope::Translate::BEGIN@13
1112µs2µsGradescope::Translate::::BEGIN@6Gradescope::Translate::BEGIN@6
0000s0sGradescope::Translate::::__ANON__[:47]Gradescope::Translate::__ANON__[:47]
0000s0sGradescope::Translate::::print_csvGradescope::Translate::print_csv
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
113µspackage Gradescope::Translate v2022.12.30 {
2224µs111µs
# spent 11µs within Gradescope::Translate::BEGIN@2 which was called: # once (11µs+0s) by main::BEGIN@50 at line 2
use v5.36;
# spent 11µs making 1 call to Gradescope::Translate::BEGIN@2
3216µs28µs
# spent 6µs (4+2) within Gradescope::Translate::BEGIN@3 which was called: # once (4µs+2µs) by main::BEGIN@50 at line 3
use utf8;
# spent 6µs making 1 call to Gradescope::Translate::BEGIN@3 # spent 2µs making 1 call to utf8::import
4327µs3916µs
# spent 464µs (12+452) within Gradescope::Translate::BEGIN@4 which was called: # once (12µs+452µs) by main::BEGIN@50 at line 4
use strictures 2; # nice `use strict`, `use warnings` defaults
# spent 464µs making 1 call to Gradescope::Translate::BEGIN@4 # spent 440µs making 1 call to strictures::import # spent 12µs making 1 call to strictures::VERSION
5224µs258µs
# spent 31µs (4+27) within Gradescope::Translate::BEGIN@5 which was called: # once (4µs+27µs) by main::BEGIN@50 at line 5
use open qw(:utf8); # try to use Perl's internal Unicode encoding for everything
# spent 31µs making 1 call to Gradescope::Translate::BEGIN@5 # spent 27µs making 1 call to open::import
6116µs12µs
# spent 2µs within Gradescope::Translate::BEGIN@6 which was called: # once (2µs+0s) by main::BEGIN@50 at line 6
BEGIN{$diagnostics::PRETTY = 1} # a bit noisy, but somewhat informative
# spent 2µs making 1 call to Gradescope::Translate::BEGIN@6
7219µs213µs
# spent 8µs (4+4) within Gradescope::Translate::BEGIN@7 which was called: # once (4µs+4µs) by main::BEGIN@50 at line 7
use diagnostics -verbose;
# spent 8µs making 1 call to Gradescope::Translate::BEGIN@7 # spent 4µs making 1 call to diagnostics::import
8
9 # turn on features
10221µs214µs
# spent 10µs (4+5) within Gradescope::Translate::BEGIN@10 which was called: # once (4µs+5µs) by main::BEGIN@50 at line 10
use builtin qw(true false is_bool reftype);
# spent 10µs making 1 call to Gradescope::Translate::BEGIN@10 # spent 5µs making 1 call to builtin::import
11218µs215µs
# spent 9µs (3+6) within Gradescope::Translate::BEGIN@11 which was called: # once (3µs+6µs) by main::BEGIN@50 at line 11
no warnings 'experimental::builtin';
# spent 9µs making 1 call to Gradescope::Translate::BEGIN@11 # spent 6µs making 1 call to warnings::unimport
12218µs278µs
# spent 41µs (4+37) within Gradescope::Translate::BEGIN@12 which was called: # once (4µs+37µs) by main::BEGIN@50 at line 12
use feature 'try';
# spent 41µs making 1 call to Gradescope::Translate::BEGIN@12 # spent 37µs making 1 call to feature::import
13215µs214µs
# spent 9µs (3+6) within Gradescope::Translate::BEGIN@13 which was called: # once (3µs+6µs) by main::BEGIN@50 at line 13
no warnings 'experimental::try';
# spent 9µs making 1 call to Gradescope::Translate::BEGIN@13 # spent 6µs making 1 call to warnings::unimport
14 # end prelude
15215µs252µs
# spent 30µs (7+23) within Gradescope::Translate::BEGIN@15 which was called: # once (7µs+23µs) by main::BEGIN@50 at line 15
use Carp;
# spent 30µs making 1 call to Gradescope::Translate::BEGIN@15 # spent 23µs making 1 call to Exporter::import
16216µs2140µs
# spent 72µs (5+68) within Gradescope::Translate::BEGIN@16 which was called: # once (5µs+68µs) by main::BEGIN@50 at line 16
use Carp::Assert;
# spent 72µs making 1 call to Gradescope::Translate::BEGIN@16 # spent 68µs making 1 call to Carp::Assert::import
17214µs215µs
# spent 11µs (6+5) within Gradescope::Translate::BEGIN@17 which was called: # once (6µs+5µs) by main::BEGIN@50 at line 17
use Text::CSV;
# spent 11µs making 1 call to Gradescope::Translate::BEGIN@17 # spent 5µs making 1 call to Exporter::import
18215µs2106µs
# spent 55µs (4+51) within Gradescope::Translate::BEGIN@18 which was called: # once (4µs+51µs) by main::BEGIN@50 at line 18
use JSON;
# spent 55µs making 1 call to Gradescope::Translate::BEGIN@18 # spent 51µs making 1 call to JSON::import
19219µs246µs
# spent 26µs (5+21) within Gradescope::Translate::BEGIN@19 which was called: # once (5µs+21µs) by main::BEGIN@50 at line 19
use File::Slurp;
# spent 26µs making 1 call to Gradescope::Translate::BEGIN@19 # spent 21µs making 1 call to Exporter::import
20
212184µs228µs
# spent 16µs (5+12) within Gradescope::Translate::BEGIN@21 which was called: # once (5µs+12µs) by main::BEGIN@50 at line 21
use parent qw(Exporter);
# spent 16µs making 1 call to Gradescope::Translate::BEGIN@21 # spent 12µs making 1 call to parent::import
22
23 # default exports
241300ns our @EXPORT = qw();
25 # optional exports
261800ns our @EXPORT_OK = qw(
27 print_csv
28 read_csv
29 );
30
31 sub print_csv {
32 my ($in, $out) = @_;
33 Text::CSV::csv({
34 # attributes (OO interface)
35 binary => 0,
36 decode_utf8 => 0,
37 strict => 1,
38 # `csv` arguments
39 in => $in,
40 out => $out,
41 encoding => ':utf8',
42 }) or confess Text::CSV->error_diag;
43 }
44
45
# spent 53715s (3.13ms+53715) within Gradescope::Translate::read_csv which was called 105 times, avg 512s/call: # 105 times (3.13ms+53715s) by main::RUNTIME at line 91 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/bin/split.pl, avg 512s/call
sub read_csv {
4610577µs my ($csv_path, $key_header, $value_header, $filter) = @_;
4710525µs $filter //= sub {true};
481052.00ms10553715s my %kv = %{Text::CSV::csv ({
# spent 53715s making 105 calls to Text::CSV_XS::csv, avg 512s/call
49 # attributes (OO interface)
50 binary => 0,
51 decode_utf8 => 0,
52 strict => 1,
53 # `csv` arguments
54 in => $csv_path,
55 filter => $filter,
56 encoding => 'UTF-8',
57 key => $key_header,
58 value => $value_header,
59 }) or confess Text::CSV->error_diag};
60105892µs return %kv;
61 }
62
63}
64
65# ABSTRACT: Gradescope submission script component
66=pod
67
68=encoding utf8
69
70=head1 DESCRIPTION
71
72C<Text::CSV> wrappers
73
74=cut