<commit_before>#!/usr/bin/perl

use warnings;
use strict;
use Getopt::Long;

my $suite = 'int';
my $xlabel = 'Version';

GetOptions(
    'xlabel=s' => \$xlabel,
    'suite=s' => \$suite,
    );

my %cols = (
    'int' => 2,
    'fp' => 4,
    );

my %titles = (
    'int' => 'Integer',
    'fp' => 'Floating Point',
    );

die "Invalid test $suite. Stopped" if (!$cols{$suite});

my $file = $ARGV[0];

my @vers;
my $arch;
open my $in, '<:encoding(UTF-8)', $file or die "Could not open '$file' for reading $!";
while (<$in>) {
    if ($_ =~ /^# versions: (.*)/) {
	@vers = split("\t", $1);
    }
    if ($_ =~ /^# arch: (\w+)/) {
	$arch = $1;
    }
}
close $in or die "Could not close '$file': $!";

die if (!@vers);
die if (!defined($arch));

my @arr;
for (my $i = 0; $i < @vers; $i++) {
    my $ver = $vers[$i];
    $arr[$i] = "'$ver' $i";
}

$arch =~ s/_/\\_/g;
print "set border linewidth 2.0\n";
print "set title '$arch NBench ", $titles{$suite}, " Performance'\n";
print "set xrange [-1:", scalar(@vers), "]\n";
print "set xtics (", join(", ", @arr), ")\n";
print "set xtics rotate\n";
print "set ylabel 'Score'\n";
print "set xlabel '$xlabel'\n";
my $col = $cols{$suite};
my $col2 = $col + 1;
my $ls = 'lw 1.5 pi -1 ps 1.2';
my @pr;
push @pr, "'$file' using 1:$col:$col2 notitle with errorbars $ls";
push @pr, "'$file' using 1:$col notitle with linespoints $ls";
print "plot ", join(", \\\n", @pr), "\n";<commit_msg>plot.pl: use noenhanced for title<commit_after>#!/usr/bin/perl

use warnings;
use strict;
use Getopt::Long;

my $suite = 'int';
my $xlabel = 'Version';

GetOptions(
    'xlabel=s' => \$xlabel,
    'suite=s' => \$suite,
    );

my %cols = (
    'int' => 2,
    'fp' => 4,
    );

my %titles = (
    'int' => 'Integer',
    'fp' => 'Floating Point',
    );

die "Invalid test $suite. Stopped" if (!$cols{$suite});

my $file = $ARGV[0];

my @vers;
my $arch;
open my $in, '<:encoding(UTF-8)', $file or die "Could not open '$file' for reading $!";
while (<$in>) {
    if ($_ =~ /^# versions: (.*)/) {
	@vers = split("\t", $1);
    }
    if ($_ =~ /^# arch: (\w+)/) {
	$arch = $1;
    }
}
close $in or die "Could not close '$file': $!";

die if (!@vers);
die if (!defined($arch));

my @arr;
for (my $i = 0; $i < @vers; $i++) {
    my $ver = $vers[$i];
    $arr[$i] = "'$ver' $i";
}

print "set border linewidth 2.0\n";
print "set title '$arch NBench ", $titles{$suite}, " Performance' noenhanced\n";
print "set xrange [-1:", scalar(@vers), "]\n";
print "set xtics (", join(", ", @arr), ")\n";
print "set xtics rotate\n";
print "set ylabel 'Score'\n";
print "set xlabel '$xlabel'\n";
my $col = $cols{$suite};
my $col2 = $col + 1;
my $ls = 'lw 1.5 pi -1 ps 1.2';
my @pr;
push @pr, "'$file' using 1:$col:$col2 notitle with errorbars $ls";
push @pr, "'$file' using 1:$col notitle with linespoints $ls";
print "plot ", join(", \\\n", @pr), "\n";
{'fraction_non_alphanumeric': 0.255862793139657, 'fraction_numerical': 0.01400070003500175, 'mean_word_length': 3.284857571214393, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4237377', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1185, 'n_words': 358}