← 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/Color.pm
StatementsExecuted 38 statements in 458µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11193µs831msGradescope::Color::::color_printGradescope::Color::color_print
1119µs9µsGradescope::Color::::BEGIN@2Gradescope::Color::BEGIN@2
1118µs439µsGradescope::Color::::BEGIN@4Gradescope::Color::BEGIN@4
1115µs15µsGradescope::Color::::BEGIN@17Gradescope::Color::BEGIN@17
1115µs13µsGradescope::Color::::BEGIN@18Gradescope::Color::BEGIN@18
1114µs13µsGradescope::Color::::BEGIN@20Gradescope::Color::BEGIN@20
1114µs9µsGradescope::Color::::BEGIN@10Gradescope::Color::BEGIN@10
1114µs21µsGradescope::Color::::BEGIN@15Gradescope::Color::BEGIN@15
1114µs5µsGradescope::Color::::BEGIN@3Gradescope::Color::BEGIN@3
1114µs24µsGradescope::Color::::BEGIN@5Gradescope::Color::BEGIN@5
1114µs11µsGradescope::Color::::BEGIN@13Gradescope::Color::BEGIN@13
1114µs59µsGradescope::Color::::BEGIN@16Gradescope::Color::BEGIN@16
1113µs6µsGradescope::Color::::BEGIN@7Gradescope::Color::BEGIN@7
1113µs33µsGradescope::Color::::BEGIN@12Gradescope::Color::BEGIN@12
1113µs9µsGradescope::Color::::BEGIN@11Gradescope::Color::BEGIN@11
1112µs2µsGradescope::Color::::BEGIN@6Gradescope::Color::BEGIN@6
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
116µspackage Gradescope::Color v2023.02.14 {
2220µs19µs
# spent 9µs within Gradescope::Color::BEGIN@2 which was called: # once (9µs+0s) by main::BEGIN@51 at line 2
use v5.36;
# spent 9µs making 1 call to Gradescope::Color::BEGIN@2
3214µs27µs
# spent 5µs (4+2) within Gradescope::Color::BEGIN@3 which was called: # once (4µs+2µs) by main::BEGIN@51 at line 3
use utf8;
# spent 5µs making 1 call to Gradescope::Color::BEGIN@3 # spent 2µs making 1 call to utf8::import
4321µs3869µs
# spent 439µs (8+430) within Gradescope::Color::BEGIN@4 which was called: # once (8µs+430µs) by main::BEGIN@51 at line 4
use strictures 2; # nice `use strict`, `use warnings` defaults
# spent 439µs making 1 call to Gradescope::Color::BEGIN@4 # spent 421µs making 1 call to strictures::import # spent 9µs making 1 call to strictures::VERSION
5221µs244µs
# spent 24µs (4+20) within Gradescope::Color::BEGIN@5 which was called: # once (4µs+20µs) by main::BEGIN@51 at line 5
use open qw(:utf8); # try to use Perl's internal Unicode encoding for everything
# spent 24µs making 1 call to Gradescope::Color::BEGIN@5 # spent 20µs making 1 call to open::import
6115µs12µs
# spent 2µs within Gradescope::Color::BEGIN@6 which was called: # once (2µs+0s) by main::BEGIN@51 at line 6
BEGIN{$diagnostics::PRETTY = 1} # a bit noisy, but somewhat informative
# spent 2µs making 1 call to Gradescope::Color::BEGIN@6
7224µs210µs
# spent 6µs (3+3) within Gradescope::Color::BEGIN@7 which was called: # once (3µs+3µs) by main::BEGIN@51 at line 7
use diagnostics -verbose;
# spent 6µs making 1 call to Gradescope::Color::BEGIN@7 # spent 3µs making 1 call to diagnostics::import
8
9 # turn on features
10221µs214µs
# spent 9µs (4+5) within Gradescope::Color::BEGIN@10 which was called: # once (4µs+5µs) by main::BEGIN@51 at line 10
use builtin qw(true false is_bool reftype);
# spent 9µs making 1 call to Gradescope::Color::BEGIN@10 # spent 5µs making 1 call to builtin::import
11216µs215µs
# spent 9µs (3+6) within Gradescope::Color::BEGIN@11 which was called: # once (3µs+6µs) by main::BEGIN@51 at line 11
no warnings 'experimental::builtin';
# spent 9µs making 1 call to Gradescope::Color::BEGIN@11 # spent 6µs making 1 call to warnings::unimport
12215µs263µs
# spent 33µs (3+30) within Gradescope::Color::BEGIN@12 which was called: # once (3µs+30µs) by main::BEGIN@51 at line 12
use feature 'try';
# spent 33µs making 1 call to Gradescope::Color::BEGIN@12 # spent 30µs making 1 call to feature::import
13214µs218µs
# spent 11µs (4+7) within Gradescope::Color::BEGIN@13 which was called: # once (4µs+7µs) by main::BEGIN@51 at line 13
no warnings 'experimental::try';
# spent 11µs making 1 call to Gradescope::Color::BEGIN@13 # spent 7µs making 1 call to warnings::unimport
14 # end prelude
15213µs238µs
# spent 21µs (4+17) within Gradescope::Color::BEGIN@15 which was called: # once (4µs+17µs) by main::BEGIN@51 at line 15
use Carp;
# spent 21µs making 1 call to Gradescope::Color::BEGIN@15 # spent 17µs making 1 call to Exporter::import
16217µs2114µs
# spent 59µs (4+55) within Gradescope::Color::BEGIN@16 which was called: # once (4µs+55µs) by main::BEGIN@51 at line 16
use Carp::Assert;
# spent 59µs making 1 call to Gradescope::Color::BEGIN@16 # spent 55µs making 1 call to Carp::Assert::import
17216µs225µs
# spent 15µs (5+10) within Gradescope::Color::BEGIN@17 which was called: # once (5µs+10µs) by main::BEGIN@51 at line 17
use IPC::Cmd qw(can_run);
# spent 15µs making 1 call to Gradescope::Color::BEGIN@17 # spent 10µs making 1 call to Exporter::import
18219µs221µs
# spent 13µs (5+8) within Gradescope::Color::BEGIN@18 which was called: # once (5µs+8µs) by main::BEGIN@51 at line 18
use IPC::Run qw(run);
# spent 13µs making 1 call to Gradescope::Color::BEGIN@18 # spent 8µs making 1 call to Exporter::import
19
202137µs222µs
# spent 13µs (4+9) within Gradescope::Color::BEGIN@20 which was called: # once (4µs+9µs) by main::BEGIN@51 at line 20
use parent qw(Exporter);
# spent 13µs making 1 call to Gradescope::Color::BEGIN@20 # spent 9µs making 1 call to parent::import
21
22 # default exports
231200ns our @EXPORT = qw();
24 # optional exports
251500ns our @EXPORT_OK = qw(
26 color_print
27 );
28
2912µs159.5ms our $has_colorizer = defined(can_run('bat'));
# spent 59.5ms making 1 call to IPC::Cmd::can_run
301300ns carp '[suggestion] get `bat` for colorized output' if !$has_colorizer;
31
32
# spent 831ms (93µs+831) within Gradescope::Color::color_print which was called: # once (93µs+831ms) by main::RUNTIME at line 97 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/bin/split.pl
sub color_print {
33128µs my ($str, $language) = @_;
34138µs1831ms if($has_colorizer && !defined($ENV{GU_NO_PAGER})){
# spent 831ms making 1 call to IPC::Run::run
35 run ['bat', '-l', $language], '<', \$str;
36 }
37 else{
38 print $str;
39 }
40 }
41
421300ns true;
43}
44
45# ABSTRACT: Gradescope submission script component
46=pod
47
48=encoding utf8
49
50=head1 DESCRIPTION
51
52=cut