File: spesh-time.p6

package info (click to toggle)
moarvm 2018.12%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,196 kB
  • sloc: ansic: 223,172; perl: 7,638; sh: 4,452; makefile: 1,089; python: 568; asm: 8
file content (16 lines) | stat: -rwxr-xr-x 700 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env perl6

sub MAIN($spesh-log) {
    with slurp($spesh-log) {
        my $stats = [+] .match(/:r 'statistics updated in ' <( \d+ )> 'us'/, :g);
        my $plan = [+] .match(/:r 'planned in ' <( \d+ )> 'us'/, :g);
        my $spesh = [+] .match(/:r 'Specialization took ' <( \d+ )> 'us'/, :g);
        my $jit = [+] .match(/:r 'JIT was ' ['not '] ? 'successful and compilation took ' <( \d+ )> 'us'/, :g);
        say qq:to/REPORT/
            Total statistics time:      {$stats / 1000}ms
            Total planning time:        {$plan / 1000}ms
            Total specialization time:  {$spesh / 1000}ms
            Total JIT time:             {$jit / 1000}ms
            REPORT
    }
}