comparison _test/temp.pl @ 407:c6e90e02dd17 ref20150831

renamed Lib->lib
author cin
date Fri, 04 Sep 2015 19:40:23 +0300
parents f23fcb19d3c1
children ee36115f6a34
comparison
equal deleted inserted replaced
406:f23fcb19d3c1 407:c6e90e02dd17
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 use strict; 2 use strict;
3 3
4 use YAML::XS; 4 use Time::HiRes qw(gettimeofday tv_interval);
5 $YAML::XS::DumpCode = 1; 5 use constant COUNT => 20000000;
6 6
7 my $conf = { 7 my $t;
8 '@include' => [qw(security view)],
9 runtime => {
10 type => 'IMPL::Web::Application',
11 params => {
12 handlers => {depdendency => 'filters'}
13 }
14 },
15 filters => [
16 { type => 'IMPL::Web::CookieAuth' },
17 { type => 'IMPL::Web::Security' },
18 { type => 'IMPL::Web::LocaleHandler',
19 params => {
20 locales => [
21 'en-US',
22 'ru-RU'
23 ],
24 default => 'en-US'
25 }
26 },
27 { type => 'IMPL::Web::ContentNegotiation' },
28 { type => 'IMPL::Web::RestController' }
29 ],
30 custom => {
31 factory => sub { return "hi!" }
32 }
33 };
34 8
35 print Dump($conf); 9 $t = [gettimeofday];
10
11 for ( my $i = 0 ; $i < COUNT ; $i++ ) {
12 my $o = [];
13 $o->[0] = 10;
14 $o->[20] = 11;
15 }
16
17 print "Arrays: ", tv_interval( $t, [gettimeofday] ), "\n";
18
19 $t = [gettimeofday];
20
21
22 for ( my $i = 0 ; $i < COUNT ; $i++ ) {
23 my $o = {};
24 $o->{a} = 10;
25 $o->{b} = 11;
26 }
27
28 print "Hashes: ", tv_interval( $t, [gettimeofday] ), "\n";
29
30
36 31
37 1; 32 1;