Mercurial > pub > Impl
view _test/temp.pl @ 212:292226770180
bugfixes
author | sergey |
---|---|
date | Fri, 29 Jun 2012 19:24:15 +0400 |
parents | 6adaeb86945d |
children | 77a9934a44af |
line wrap: on
line source
#!/usr/bin/perl use strict; use Time::HiRes qw(gettimeofday tv_interval); my $obj = {}; my @vals = qw(a b c d e f g h i j k); my @names = qw(one two three four five six); sub CreateMethod { my ($dt) = @_; $obj->{one} = $vals[1]; $obj->{two} = $vals[2]; $obj->{three} = $vals[3]; $obj->{four} = $vals[4]; $obj->{five} = $vals[5]; $obj->{six} = $vals[6]; } my @pairs = map { [$names[$_],$_] } (1 .. $#names); sub CreateMethodEval { my ($dt) = @_; my $i = 0; map $obj->{$_} = $vals[$i++], @names; } my $t = [gettimeofday]; CreateMethod($_) foreach (1..1000000); print "Build: ",tv_interval($t,[gettimeofday]),"\n"; $t = [gettimeofday]; CreateMethodEval($_) foreach (1..1000000); print "Eval: ",tv_interval($t,[gettimeofday]),"\n"; use URI::Escape; print uri_escape("/child///&?"), "\n";