diff --git a/README.md b/README.md index a63ce3c..5f9033e 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,13 @@ Benchmark and compare different pieces of code. fast => sub{ ... }, }, 10000; + $ perl -Me -e '$v = 333; n { concat => sub { 111 . $v }, interp => sub { "111$v" }, list => sub { 111,$v } }, 100000000' + + Rate interp concat list + interp 55248619/s -- -6% -62% + concat 58479532/s 6% -- -60% + list 144927536/s 162% 148% -- + ## Format Conversions ### j diff --git a/lib/e.pm b/lib/e.pm index 7b171d0..a70ae6d 100644 --- a/lib/e.pm +++ b/lib/e.pm @@ -232,6 +232,13 @@ Benchmark and compare different pieces of code. fast => sub{ ... }, }, 10000; + $ perl -Me -e '$v = 333; n { concat => sub { 111 . $v }, interp => sub { "111$v" }, list => sub { 111,$v } }, 100000000' + + Rate interp concat list + interp 55248619/s -- -6% -62% + concat 58479532/s 6% -- -60% + list 144927536/s 162% 148% -- + =cut =head2 Format Conversions