]> iEval git - gruntmaster-data.git/blob - bm.pl
0dc688d74cbe3240395b9382ebaaa79de7eaa01d
[gruntmaster-data.git] / bm.pl
1 #!/usr/bin/perl
2 use v5.14;
3 use warnings;
4
5 use lib 'lib';
6
7 use Benchmark;
8 use Gruntmaster::Data;
9
10 my $db = Gruntmaster::Data->connect('dbi:Pg:');
11
12 timethese(-1, {
13 orig => sub { $db->user_list_orig },
14 new => sub { $db->user_entry },
15 });
16
17 timethese(-1, {
18 orig => sub { $db->user_entry_orig('PlayLikeNeverB4') },
19 new => sub { $db->user_entry('PlayLikeNeverB4') },
20 });
21
22 timethese(-1, {
23 orig => sub { $db->contest_list_orig },
24 new => sub { $db->contest_entry },
25 });
26
27 timethese(-1, {
28 orig => sub { $db->contest_entry_orig('mc2015r4') },
29 new => sub { $db->contest_entry('mc2015r4') },
30 });
31
32 timethese(-1, {
33 orig => sub { $db->problem_list_orig },
34 new => sub { $db->problem_list },
35 });
36
37 timethese(-1, {
38 orig => sub { $db->problem_entry_orig('aplusb') },
39 new => sub { $db->problem_entry('aplusb') },
40 });
41
42 timethese(50, {
43 orig => sub { $db->job_list_orig },
44 new => sub { $db->job_list },
45 });
46
47 timethese(-1, {
48 orig => sub { $db->job_entry_orig(9000) },
49 new => sub { $db->job_entry(9000) },
50 });
51
52 timethese(10, {
53 orig => sub { $db->update_status_orig },
54 new => sub { $db->update_status },
55 });
This page took 0.036786 seconds and 3 git commands to generate.