[libmoosex-has-sugar-perl] 03/11: Make test more like the actual scenario, narrowing the percentage difference, but return still wins by ~10%
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 27 21:35:37 UTC 2014
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to annotated tag 1.000002-source
in repository libmoosex-has-sugar-perl.
commit ec78ca8af1f935ffec6ba6a04592fe2151419d68
Author: Kent Fredric <kentfredric at gmail.com>
Date: Thu Jun 26 08:16:45 2014 +1200
Make test more like the actual scenario, narrowing the percentage difference, but return still wins by ~10%
---
benchmark/bench_return.pl | 64 +++++++++++++++++++++++++++++------------------
1 file changed, 40 insertions(+), 24 deletions(-)
diff --git a/benchmark/bench_return.pl b/benchmark/bench_return.pl
index 41a9562..755bd5d 100644
--- a/benchmark/bench_return.pl
+++ b/benchmark/bench_return.pl
@@ -8,52 +8,68 @@ use warnings;
use utf8;
sub constant_return() {
- return ( 'is', 'ro' );
+ return ( 'is', 'ro' );
}
sub constant_bare() {
- ( 'is', 'ro' );
+ ( 'is', 'ro' );
}
use Benchmark qw( :all :hireswallclock );
cmpthese(
- -2,
- {
- return => sub { my $x = constant_return },
- bare => sub { my $x = constant_bare },
- return2 => sub { my $x = constant_return },
- bare2 => sub { my $x = constant_bare },
- }
+ -2,
+ {
+ return => sub {
+ my @x;
+ @x = constant_return for 0 .. 100;
+ },
+ bare => sub {
+ my @x;
+ @x = constant_bare for 0 .. 100;
+ },
+ return2 => sub {
+ my @x;
+ @x = constant_return for 0 .. 100;
+ },
+ bare2 => sub {
+ my @x;
+ @x = constant_bare for 0 .. 100;
+ },
+ }
);
__END__
5.21.1
config_args='-de -Dusecbacktrace -Doptimize=-O3 -march=native -mtune=native -g -ggdb3 -Dusedevel -Accflags=-DUSE_C_BACKTRACE_ON_ERROR -Aldflags=-lbfd
- Rate bare bare2 return2 return
-bare 3130035/s -- -1% -6% -8%
-bare2 3171097/s 1% -- -5% -6%
-return2 3329940/s 6% 5% -- -2%
-return 3389788/s 8% 7% 2% --
+ Rate bare bare2 return2 return
+bare2 16364/s -- -1% -6% -6%
+bare 16527/s 1% -- -5% -5%
+return2 17436/s 7% 6% -- -0%
+return 17436/s 7% 6% 0% --
5.10.1
config_args='-de'
+ Rate bare bare2 return2 return
+bare 12155/s -- -0% -1% -1%
+bare2 12190/s 0% -- -1% -1%
+return2 12272/s 1% 1% -- -0%
+return 12272/s 1% 1% 0% --
+
5.18.0
config_args='-de'
Rate bare bare2 return return2
-bare 2929449/s -- -3% -7% -9%
-bare2 3023864/s 3% -- -4% -6%
-return 3157930/s 8% 4% -- -2%
-return2 3220760/s 10% 7% 2% --
-
+bare2 12597/s -- -1% -4% -4%
+bare 12664/s 1% -- -4% -4%
+return2 13149/s 4% 4% -- -0%
+return 13149/s 4% 4% 0% --
5.12.5
config_args='-de'
Rate bare bare2 return2 return
-bare 3188585/s -- -1% -5% -5%
-bare2 3220761/s 1% -- -4% -5%
-return2 3339732/s 5% 4% -- -1%
-return 3372640/s 6% 5% 1% --
-
+bare 10803/s -- -3% -7% -7%
+bare2 11112/s 3% -- -4% -4%
+return 11555/s 7% 4% -- -0%
+return2 11600/s 7% 4% 0% --
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-has-sugar-perl.git
More information about the Pkg-perl-cvs-commits
mailing list