From 4f1c50e47a6bb8303ef5fa224a8f28a7623ab10d Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Mon, 22 May 2017 15:22:58 -0300 Subject: [PATCH] doc: now is more reasy to add a new test --- Makefile.example | 21 +----- README.md | 19 +----- class-classless/Makefile | 21 +----- class-classless/README.md | 54 +++++---------- class-classless/benchmark2.js | 5 +- class-module/Makefile | 21 +----- class-module/README.md | 54 +++++---------- class-module/benchmark2.js | 5 +- class-prototype/Makefile | 21 +----- class-prototype/README.md | 66 +++++++------------ class-prototype/benchmark2.js | 5 +- class-unfrozenclassless/Makefile | 21 +----- class-unfrozenclassless/README.md | 54 +++++---------- class-unfrozenclassless/benchmark2.js | 5 +- filter-filter_by_hand/Makefile | 21 +----- filter-filter_by_hand/README.md | 52 +++++---------- filter-filter_by_hand/benchmark2.js | 5 +- foreach-for/Makefile | 21 +----- foreach-for/README.md | 54 +++++---------- foreach-for/benchmark2.js | 5 +- .../Makefile | 21 +----- .../README.md | 58 +++++----------- .../benchmark2.js | 5 +- hidden_class-no_extra_hidden_class/Makefile | 21 +----- hidden_class-no_extra_hidden_class/README.md | 58 +++++----------- .../benchmark2.js | 5 +- map-map_by_hand/Makefile | 21 +----- map-map_by_hand/README.md | 54 +++++---------- map-map_by_hand/benchmark2.js | 5 +- named_function-arrow_function/Makefile | 21 +----- named_function-arrow_function/README.md | 58 +++++----------- named_function-arrow_function/benchmark2.js | 5 +- object_assign-util_extend/Makefile | 22 +------ object_assign-util_extend/README.md | 55 +++++----------- object_assign-util_extend/benchmark2.js | 13 ++-- reduce-reduce_by_hand/Makefile | 21 +----- reduce-reduce_by_hand/README.md | 54 +++++---------- reduce-reduce_by_hand/benchmark2.js | 5 +- weakmap-symbol/Makefile | 21 +----- weakmap-symbol/README.md | 52 +++++---------- weakmap-symbol/benchmark2.js | 13 ++-- 41 files changed, 255 insertions(+), 863 deletions(-) diff --git a/Makefile.example b/Makefile.example index ee44b5f..45909c8 100644 --- a/Makefile.example +++ b/Makefile.example @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-foo.js > /dev/null <--Here you need to add your prof-foo.js - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-foo.txt <--Here you name the file like tick-foo.txt - rm *.log && rm out.txt - node --prof prof-bar.js > /dev/null <--Here you need to add your prof-bar.js - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-bar.txt <--Here you name the file like tick-bar.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-foo' >> README.md <--Here you need to change - echo '```' >> README.md - cat tick-foo.txt >> README.md <--Here you need to change - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-bar' >> README.md <--Here you need to change - echo '```' >> README.md - cat tick-bar.txt >> README.md <--Here you need to change - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/README.md b/README.md index 2601554..a28b1ae 100644 --- a/README.md +++ b/README.md @@ -16,26 +16,13 @@ - [reduce and reduce by hand](reduce-reduce_by_hand/#readme) - [Function expression and function statement](function_expression-function_statement/#readme) - [WeakMap and Symbol](weakmap-symbol/#readme) +- [object assign and util extend](object_assign-util_extend/#readme) ### How to push a test case - Create a new directory using the rule `foo-bar` or `function_foo-function_bar` - Create benchmark.js and benchmark2.js files and add your bench code (look the other tests to get help). -- Create a prof-foo.js and prof-bar.js and replicate the bench code from step 2. -using as comparision, the same function call, like this: - -``` -exports.compare = { - 'arrow1': function () { - foo(1); - }, - 'arrow2': function () { - foo(1); - } -}; -``` - -- Copy Makefile.example from the root directory, rename it to Makefile and change for your needs. +- Copy Makefile.example from the root directory, rename it to Makefile. - Type `make` inside your test case directory. - Add the test case on Makefile located on project root directory. - To run all the tests type `make` from project root directory. @@ -43,5 +30,3 @@ exports.compare = { ## Benchmarks Benchmarks are notoriously a lot like statistics so take this with a grain of salt. -Results from a simplified, non-scientific benchmark performed on a -Lenovo T440 Linux 4.8.4-1-ARCH x86_64. Your results may vary. \ No newline at end of file diff --git a/class-classless/Makefile b/class-classless/Makefile index d81aee3..45909c8 100644 --- a/class-classless/Makefile +++ b/class-classless/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-class.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-class.txt - rm *.log && rm out.txt - node --prof prof-classless.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-classless.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-class' >> README.md - echo '```' >> README.md - cat tick-class.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-classless' >> README.md - echo '```' >> README.md - cat tick-classless.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/class-classless/README.md b/class-classless/README.md index 4aa65cb..78cbf9a 100644 --- a/class-classless/README.md +++ b/class-classless/README.md @@ -3,25 +3,25 @@ ``` class Raw: - > 146117.8821178821 - > 144694.3056943057 - > 148963.03696303695 - > 147041.95804195805 -Average (mean) 146704.2957042957 + > 158595.4045954046 + > 154682.3176823177 + > 156602.3976023976 + > 157400.5994005994 +Average (mean) 156820.17982017982 classless Raw: - > 11836.163836163836 - > 11582.417582417582 - > 11775.224775224775 - > 11757.242757242757 -Average (mean) 11737.762237762236 + > 11382.617382617382 + > 11383.616383616383 + > 11547.452547452547 + > 11587.412587412588 +Average (mean) 11475.274725274725 Winner: class Compared with next highest (classless), it's: -92% faster -12.5 times as fast -1.1 order(s) of magnitude faster +92.68% faster +13.67 times as fast +1.14 order(s) of magnitude faster A LOT FASTER ``` @@ -29,31 +29,9 @@ A LOT FASTER ## Benchmark 2 ``` -class x 93,099,236 ops/sec ±1.02% (88 runs sampled) -classless x 10,524,368 ops/sec ±1.20% (90 runs sampled) + +class x 94,362,425 ops/sec ±1.49% (91 runs sampled) +classless x 10,535,684 ops/sec ±1.40% (87 runs sampled) Fastest is: class -[null] -``` - -## Profile summary - -Tick-class -``` - [Summary]: - ticks total nonlib name - 6554 69.8% 84.9% JavaScript - 441 4.7% 5.7% C++ - 3 0.0% 0.0% GC - 1668 17.8% Shared libraries -``` - -Tick-classless -``` - [Summary]: - ticks total nonlib name - 3690 39.4% 40.0% JavaScript - 4906 52.3% 53.2% C++ - 152 1.6% 1.6% GC - 152 1.6% Shared libraries ``` diff --git a/class-classless/benchmark2.js b/class-classless/benchmark2.js index 784827c..717c182 100644 --- a/class-classless/benchmark2.js +++ b/class-classless/benchmark2.js @@ -39,8 +39,5 @@ suite .add('class', a) .add('classless', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/class-module/Makefile b/class-module/Makefile index 986fabc..45909c8 100644 --- a/class-module/Makefile +++ b/class-module/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-class.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-class.txt - rm *.log && rm out.txt - node --prof prof-module.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-module.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-class' >> README.md - echo '```' >> README.md - cat tick-class.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-module' >> README.md - echo '```' >> README.md - cat tick-module.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/class-module/README.md b/class-module/README.md index 6fd8f13..6d1c158 100644 --- a/class-module/README.md +++ b/class-module/README.md @@ -3,25 +3,25 @@ ``` class Raw: - > 155963.03696303695 - > 149779.22077922078 - > 148795.2047952048 - > 148605.3946053946 -Average (mean) 150785.7142857143 + > 149900.0999000999 + > 142729.27072927073 + > 140208.7912087912 + > 141633.36663336665 +Average (mean) 143617.88211788214 module Raw: - > 17559.440559440558 - > 17163.836163836164 - > 17585.414585414586 - > 16742.25774225774 -Average (mean) 17262.737262737264 + > 17664.335664335664 + > 16118.88111888112 + > 16563.436563436564 + > 17655.344655344656 +Average (mean) 17000.4995004995 Winner: class Compared with next highest (module), it's: -88.55% faster -8.73 times as fast -0.94 order(s) of magnitude faster +88.16% faster +8.45 times as fast +0.93 order(s) of magnitude faster QUITE A BIT FASTER ``` @@ -29,31 +29,9 @@ QUITE A BIT FASTER ## Benchmark 2 ``` -class x 94,028,915 ops/sec ±1.08% (86 runs sampled) -module x 16,180,711 ops/sec ±0.80% (92 runs sampled) + +class x 91,764,281 ops/sec ±2.30% (87 runs sampled) +module x 15,397,893 ops/sec ±1.94% (83 runs sampled) Fastest is: class -[null] -``` - -## Profile summary - -Tick-class -``` - [Summary]: - ticks total nonlib name - 6260 66.8% 81.1% JavaScript - 399 4.3% 5.2% C++ - 8 0.1% 0.1% GC - 1652 17.6% Shared libraries -``` - -Tick-module -``` - [Summary]: - ticks total nonlib name - 7479 79.5% 82.2% JavaScript - 1068 11.4% 11.7% C++ - 342 3.6% 3.8% GC - 304 3.2% Shared libraries ``` diff --git a/class-module/benchmark2.js b/class-module/benchmark2.js index 4035965..399d1a2 100644 --- a/class-module/benchmark2.js +++ b/class-module/benchmark2.js @@ -39,8 +39,5 @@ suite .add('class', a) .add('module', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/class-prototype/Makefile b/class-prototype/Makefile index 63fde0a..45909c8 100644 --- a/class-prototype/Makefile +++ b/class-prototype/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-class.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-class.txt - rm *.log && rm out.txt - node --prof prof-prototype.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-prototype.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-class' >> README.md - echo '```' >> README.md - cat tick-class.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-prototype' >> README.md - echo '```' >> README.md - cat tick-prototype.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/class-prototype/README.md b/class-prototype/README.md index 76f54b9..54257ff 100644 --- a/class-prototype/README.md +++ b/class-prototype/README.md @@ -1,59 +1,37 @@ ## Benchmark ``` -prototype +class Raw: - > 153309.6903096903 - > 156191.8081918082 - > 163612.38761238763 - > 161768.23176823178 -Average (mean) 158720.52947052947 + > 162958.04195804195 + > 162206.7932067932 + > 160821.17882117882 + > 157369.63036963038 +Average (mean) 160838.9110889111 -class +prototype Raw: - > 153030.96903096902 - > 150089.9100899101 - > 158000.999000999 - > 151661.33866133867 -Average (mean) 153195.8041958042 + > 152504.4955044955 + > 166918.0819180819 + > 151758.24175824175 + > 162640.35964035965 +Average (mean) 158455.2947052947 -Winner: prototype -Compared with next highest (class), it's: -3.48% faster -1.04 times as fast -0.02 order(s) of magnitude faster -A LITTLE FASTER +Winner: class +Compared with next highest (prototype), it's: +1.48% faster +1.02 times as fast +0.01 order(s) of magnitude faster +BASICALLY THE SAME ``` ## Benchmark 2 ``` -class x 93,904,507 ops/sec ±1.19% (86 runs sampled) -prototype x 91,929,799 ops/sec ±1.08% (88 runs sampled) -Fastest is: class -[null] -``` - -## Profile summary - -Tick-class -``` - [Summary]: - ticks total nonlib name - 6275 67.0% 81.9% JavaScript - 405 4.3% 5.3% C++ - 6 0.1% 0.1% GC - 1712 18.3% Shared libraries -``` - -Tick-prototype -``` - [Summary]: - ticks total nonlib name - 6600 70.4% 85.9% JavaScript - 377 4.0% 4.9% C++ - 4 0.0% 0.1% GC - 1693 18.1% Shared libraries + +class x 95,661,693 ops/sec ±1.39% (87 runs sampled) +prototype x 97,498,677 ops/sec ±1.29% (85 runs sampled) +Fastest is: prototype ``` diff --git a/class-prototype/benchmark2.js b/class-prototype/benchmark2.js index 20cbaec..48f1653 100644 --- a/class-prototype/benchmark2.js +++ b/class-prototype/benchmark2.js @@ -34,8 +34,5 @@ suite .add('class', a) .add('prototype', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/class-unfrozenclassless/Makefile b/class-unfrozenclassless/Makefile index 304ddf8..45909c8 100644 --- a/class-unfrozenclassless/Makefile +++ b/class-unfrozenclassless/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-class.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-class.txt - rm *.log && rm out.txt - node --prof prof-unfrozenclassless.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-unfrozenclassless.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-class' >> README.md - echo '```' >> README.md - cat tick-class.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-unfrozenclassless' >> README.md - echo '```' >> README.md - cat tick-unfrozenclassless.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/class-unfrozenclassless/README.md b/class-unfrozenclassless/README.md index 88bf409..1314533 100644 --- a/class-unfrozenclassless/README.md +++ b/class-unfrozenclassless/README.md @@ -3,25 +3,25 @@ ``` class Raw: - > 150787.21278721277 - > 149499.5004995005 - > 150046.95304695304 - > 151741.25874125873 -Average (mean) 150518.73126873127 + > 151430.56943056942 + > 154077.9220779221 + > 155237.76223776225 + > 158510.4895104895 +Average (mean) 154814.18581418582 classless Raw: - > 24446.553446553447 - > 23523.476523476522 - > 23070.929070929073 - > 23272.727272727272 -Average (mean) 23578.421578421578 + > 25581.41858141858 + > 25510.48951048951 + > 24833.166833166833 + > 25193.806193806195 +Average (mean) 25279.720279720277 Winner: class Compared with next highest (classless), it's: -84.34% faster -6.38 times as fast -0.81 order(s) of magnitude faster +83.67% faster +6.12 times as fast +0.79 order(s) of magnitude faster QUITE A BIT FASTER ``` @@ -29,31 +29,9 @@ QUITE A BIT FASTER ## Benchmark 2 ``` -class x 93,455,371 ops/sec ±0.92% (91 runs sampled) -unfrozenclassless x 20,197,160 ops/sec ±0.73% (89 runs sampled) + +class x 95,060,522 ops/sec ±1.30% (90 runs sampled) +unfrozenclassless x 20,493,260 ops/sec ±1.79% (88 runs sampled) Fastest is: class -[null] -``` - -## Profile summary - -Tick-class -``` - [Summary]: - ticks total nonlib name - 6658 71.1% 85.7% JavaScript - 396 4.2% 5.1% C++ - 5 0.1% 0.1% GC - 1598 17.1% Shared libraries -``` - -Tick-unfrozenclassless -``` - [Summary]: - ticks total nonlib name - 7190 76.8% 79.7% JavaScript - 1187 12.7% 13.2% C++ - 323 3.5% 3.6% GC - 339 3.6% Shared libraries ``` diff --git a/class-unfrozenclassless/benchmark2.js b/class-unfrozenclassless/benchmark2.js index f06a04a..1dff3c9 100644 --- a/class-unfrozenclassless/benchmark2.js +++ b/class-unfrozenclassless/benchmark2.js @@ -39,8 +39,5 @@ suite .add('class', a) .add('unfrozenclassless', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/filter-filter_by_hand/Makefile b/filter-filter_by_hand/Makefile index 8f214a5..45909c8 100644 --- a/filter-filter_by_hand/Makefile +++ b/filter-filter_by_hand/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-filter.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-filter.txt - rm *.log && rm out.txt - node --prof prof-filter_by_hand.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-filter_by_hand.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-filter' >> README.md - echo '```' >> README.md - cat tick-filter.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-filter_by_hand' >> README.md - echo '```' >> README.md - cat tick-filter_by_hand.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/filter-filter_by_hand/README.md b/filter-filter_by_hand/README.md index a72f69d..81f4160 100644 --- a/filter-filter_by_hand/README.md +++ b/filter-filter_by_hand/README.md @@ -3,25 +3,25 @@ ``` filterByHand Raw: - > 17075.924075924075 - > 17215.784215784217 - > 17061.93806193806 - > 16786.213786213786 -Average (mean) 17034.965034965033 + > 16146.853146853147 + > 16787.212787212786 + > 16784.215784215783 + > 16245.754245754246 +Average (mean) 16491.008991008992 filterr Raw: - > 1640.3596403596403 - > 1672.3276723276724 - > 1691.3086913086913 + > 1569.4305694305694 > 1592.4075924075923 -Average (mean) 1649.1008991008991 + > 1688.3116883116884 + > 1681.3186813186812 +Average (mean) 1632.8671328671328 Winner: filterByHand Compared with next highest (filterr), it's: -90.32% faster -10.33 times as fast -1.01 order(s) of magnitude faster +90.1% faster +10.1 times as fast +1 order(s) of magnitude faster A LOT FASTER ``` @@ -29,31 +29,9 @@ A LOT FASTER ## Benchmark 2 ``` -filterr x 1,631,328 ops/sec ±0.63% (92 runs sampled) -filterByHand x 15,225,074 ops/sec ±0.88% (89 runs sampled) + +filterr x 1,573,626 ops/sec ±2.37% (86 runs sampled) +filterByHand x 14,671,741 ops/sec ±1.51% (87 runs sampled) Fastest is: filterByHand -[null] -``` - -## Profile summary - -Tick-filter -``` - [Summary]: - ticks total nonlib name - 3280 35.0% 35.1% JavaScript - 5425 57.9% 58.1% C++ - 369 3.9% 4.0% GC - 38 0.4% Shared libraries -``` - -Tick-filter_by_hand -``` - [Summary]: - ticks total nonlib name - 7946 84.9% 87.0% JavaScript - 508 5.4% 5.6% C++ - 309 3.3% 3.4% GC - 222 2.4% Shared libraries ``` diff --git a/filter-filter_by_hand/benchmark2.js b/filter-filter_by_hand/benchmark2.js index 179e1d4..2f6ce15 100644 --- a/filter-filter_by_hand/benchmark2.js +++ b/filter-filter_by_hand/benchmark2.js @@ -33,8 +33,5 @@ suite .add('filterr', a) .add('filterByHand', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/foreach-for/Makefile b/foreach-for/Makefile index 2d17f96..45909c8 100644 --- a/foreach-for/Makefile +++ b/foreach-for/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-for.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-for.txt - rm *.log && rm out.txt - node --prof prof-foreach.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-foreach.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-for' >> README.md - echo '```' >> README.md - cat tick-for.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-foreach' >> README.md - echo '```' >> README.md - cat tick-foreach.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/foreach-for/README.md b/foreach-for/README.md index 192264f..322c2a2 100644 --- a/foreach-for/README.md +++ b/foreach-for/README.md @@ -3,25 +3,25 @@ ``` for Raw: - > 4.672897196261682 - > 4.545454545454546 - > 4.84027105517909 - > 4.616805170821792 -Average (mean) 4.668856991929277 + > 4.480286738351254 + > 4.436557231588288 + > 4.291845493562231 + > 4.504504504504505 +Average (mean) 4.42829849200157 forEach Raw: - > 0.6688963210702341 - > 0.6605019815059445 - > 0.6583278472679395 - > 0.6544502617801047 -Average (mean) 0.6605441029060557 + > 0.6830601092896175 + > 0.6770480704129993 + > 0.6770480704129993 + > 0.6807351940095303 +Average (mean) 0.6794728610312866 Winner: for Compared with next highest (forEach), it's: -85.85% faster -7.07 times as fast -0.85 order(s) of magnitude faster +84.66% faster +6.52 times as fast +0.81 order(s) of magnitude faster QUITE A BIT FASTER ``` @@ -29,31 +29,9 @@ QUITE A BIT FASTER ## Benchmark 2 ``` -forEach x 652 ops/sec ±0.84% (89 runs sampled) -for x 4,506 ops/sec ±0.94% (85 runs sampled) + +forEach x 623 ops/sec ±1.56% (86 runs sampled) +for x 4,689 ops/sec ±1.10% (85 runs sampled) Fastest is: for -[null] -``` - -## Profile summary - -Tick-for -``` - [Summary]: - ticks total nonlib name - 9971 99.3% 99.3% JavaScript - 58 0.6% 0.6% C++ - 1 0.0% 0.0% GC - 2 0.0% Shared libraries -``` - -Tick-foreach -``` - [Summary]: - ticks total nonlib name - 13371 95.4% 95.4% JavaScript - 61 0.4% 0.4% C++ - 2 0.0% 0.0% GC - 1 0.0% Shared libraries ``` diff --git a/foreach-for/benchmark2.js b/foreach-for/benchmark2.js index fa56bd6..0990cbf 100644 --- a/foreach-for/benchmark2.js +++ b/foreach-for/benchmark2.js @@ -36,8 +36,5 @@ suite .add('forEach', each) .add('for', forr) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/function_expression-function_statement/Makefile b/function_expression-function_statement/Makefile index 080602a..45909c8 100644 --- a/function_expression-function_statement/Makefile +++ b/function_expression-function_statement/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-function_expression.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-function_expression.txt - rm *.log && rm out.txt - node --prof prof-function_statement.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-function_statement.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-function_expression' >> README.md - echo '```' >> README.md - cat tick-function_expression.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-function_statement' >> README.md - echo '```' >> README.md - cat tick-function_statement.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/function_expression-function_statement/README.md b/function_expression-function_statement/README.md index de129c0..fd8fabb 100644 --- a/function_expression-function_statement/README.md +++ b/function_expression-function_statement/README.md @@ -3,57 +3,35 @@ ``` statement Raw: - > 157321.6783216783 - > 157156.84315684316 - > 157931.06893106893 - > 157659.34065934067 -Average (mean) 157517.23276723275 + > 166251.74825174824 + > 152104.8951048951 + > 159343.65634365633 + > 151496.5034965035 +Average (mean) 157299.2007992008 expression Raw: - > 153456.54345654347 - > 152061.93806193807 - > 151914.0859140859 - > 151771.22877122878 -Average (mean) 152300.94905094904 + > 157080.9190809191 + > 157118.8811188811 + > 156147.85214785216 + > 153887.1128871129 +Average (mean) 156058.6913086913 Winner: statement Compared with next highest (expression), it's: -3.31% faster -1.03 times as fast -0.01 order(s) of magnitude faster -A LITTLE FASTER +0.79% faster +1.01 times as fast +0 order(s) of magnitude faster +BASICALLY THE SAME ``` ## Benchmark 2 ``` -expression x 98,467,965 ops/sec ±0.91% (88 runs sampled) -statement x 96,224,446 ops/sec ±1.04% (85 runs sampled) -Fastest is: expression -[null] -``` - -## Profile summary - -Tick-function_expression -``` - [Summary]: - ticks total nonlib name - 6522 69.5% 84.6% JavaScript - 365 3.9% 4.7% C++ - 4 0.0% 0.1% GC - 1673 17.8% Shared libraries -``` - -Tick-function_statement -``` - [Summary]: - ticks total nonlib name - 6534 69.7% 85.8% JavaScript - 405 4.3% 5.3% C++ - 4 0.0% 0.1% GC - 1759 18.8% Shared libraries + +expression x 97,168,468 ops/sec ±1.06% (90 runs sampled) +statement x 97,763,650 ops/sec ±1.37% (90 runs sampled) +Fastest is: statement,expression ``` diff --git a/function_expression-function_statement/benchmark2.js b/function_expression-function_statement/benchmark2.js index 61945d5..d00a0f1 100644 --- a/function_expression-function_statement/benchmark2.js +++ b/function_expression-function_statement/benchmark2.js @@ -16,8 +16,5 @@ suite .add('expression', foo) .add('statement', bar) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/hidden_class-no_extra_hidden_class/Makefile b/hidden_class-no_extra_hidden_class/Makefile index c366460..45909c8 100644 --- a/hidden_class-no_extra_hidden_class/Makefile +++ b/hidden_class-no_extra_hidden_class/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-hidden.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-hidden.txt - rm *.log && rm out.txt - node --prof prof-no_extra_hidden.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-no_extra_hidden.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-hidden' >> README.md - echo '```' >> README.md - cat tick-hidden.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-no_extra_hidden' >> README.md - echo '```' >> README.md - cat tick-no_extra_hidden.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/hidden_class-no_extra_hidden_class/README.md b/hidden_class-no_extra_hidden_class/README.md index c0ea499..dab8abd 100644 --- a/hidden_class-no_extra_hidden_class/README.md +++ b/hidden_class-no_extra_hidden_class/README.md @@ -3,57 +3,35 @@ ``` no_extra_hidden Raw: - > 166151.84815184816 - > 156482.5174825175 - > 156166.83316683318 - > 155555.44455544456 -Average (mean) 158589.16083916085 + > 158909.0909090909 + > 155093.9060939061 + > 158384.61538461538 + > 154764.23576423575 +Average (mean) 156787.96203796202 hidden Raw: - > 155446.55344655344 - > 150092.9070929071 - > 152978.02197802198 - > 149158.84115884115 -Average (mean) 151919.0809190809 + > 42468.531468531466 + > 45235.76423576423 + > 44073.92607392607 + > 40497.5024975025 +Average (mean) 43068.931068931066 Winner: no_extra_hidden Compared with next highest (hidden), it's: -4.21% faster -1.04 times as fast -0.02 order(s) of magnitude faster -A LITTLE FASTER +72.53% faster +3.64 times as fast +0.56 order(s) of magnitude faster +QUITE A BIT FASTER ``` ## Benchmark 2 ``` -hidden x 94,371,755 ops/sec ±1.85% (88 runs sampled) -no_extra_hidden x 94,745,086 ops/sec ±0.91% (91 runs sampled) -Fastest is: no_extra_hidden,hidden -[null] -``` - -## Profile summary - -Tick-hidden -``` - [Summary]: - ticks total nonlib name - 6536 69.7% 85.8% JavaScript - 398 4.2% 5.2% C++ - 6 0.1% 0.1% GC - 1758 18.7% Shared libraries -``` - -Tick-no_extra_hidden -``` - [Summary]: - ticks total nonlib name - 6623 70.7% 86.0% JavaScript - 406 4.3% 5.3% C++ - 8 0.1% 0.1% GC - 1668 17.8% Shared libraries + +hidden x 93,835,086 ops/sec ±1.62% (89 runs sampled) +no_extra_hidden x 87,475,938 ops/sec ±1.39% (88 runs sampled) +Fastest is: hidden ``` diff --git a/hidden_class-no_extra_hidden_class/benchmark2.js b/hidden_class-no_extra_hidden_class/benchmark2.js index 70ecf56..fdef8f2 100644 --- a/hidden_class-no_extra_hidden_class/benchmark2.js +++ b/hidden_class-no_extra_hidden_class/benchmark2.js @@ -24,8 +24,5 @@ suite .add('hidden', a) .add('no_extra_hidden', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/map-map_by_hand/Makefile b/map-map_by_hand/Makefile index 2e7d1df..45909c8 100644 --- a/map-map_by_hand/Makefile +++ b/map-map_by_hand/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-map.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-map.txt - rm *.log && rm out.txt - node --prof prof-map_by_hand.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-map_by_hand.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-map' >> README.md - echo '```' >> README.md - cat tick-map.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-map_by_hand' >> README.md - echo '```' >> README.md - cat tick-map_by_hand.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/map-map_by_hand/README.md b/map-map_by_hand/README.md index 04269c6..6301853 100644 --- a/map-map_by_hand/README.md +++ b/map-map_by_hand/README.md @@ -3,25 +3,25 @@ ``` mapByHand Raw: - > 15794.205794205795 - > 16323.676323676324 - > 15974.025974025973 - > 15512.487512487513 -Average (mean) 15901.0989010989 + > 16716.283716283717 + > 15994.005994005995 + > 15944.055944055945 + > 13569.43056943057 +Average (mean) 15555.944055944055 mapp Raw: - > 1593.4065934065934 - > 1566.4335664335665 - > 1592.4075924075923 - > 1580.4195804195804 -Average (mean) 1583.1668331668332 + > 1458.5414585414585 + > 1598.4015984015984 + > 1584.4155844155844 + > 1412.5874125874127 +Average (mean) 1513.4865134865136 Winner: mapByHand Compared with next highest (mapp), it's: -90.04% faster -10.04 times as fast -1 order(s) of magnitude faster +90.27% faster +10.28 times as fast +1.01 order(s) of magnitude faster A LOT FASTER ``` @@ -29,31 +29,9 @@ A LOT FASTER ## Benchmark 2 ``` -map x 1,524,011 ops/sec ±0.77% (90 runs sampled) -mapByHand x 14,463,070 ops/sec ±0.93% (91 runs sampled) + +map x 1,460,949 ops/sec ±2.25% (87 runs sampled) +mapByHand x 13,580,541 ops/sec ±2.22% (85 runs sampled) Fastest is: mapByHand -[null] -``` - -## Profile summary - -Tick-map -``` - [Summary]: - ticks total nonlib name - 2678 28.6% 28.7% JavaScript - 5921 63.3% 63.5% C++ - 246 2.6% 2.6% GC - 33 0.4% Shared libraries -``` - -Tick-map_by_hand -``` - [Summary]: - ticks total nonlib name - 7984 85.4% 87.5% JavaScript - 459 4.9% 5.0% C++ - 289 3.1% 3.2% GC - 223 2.4% Shared libraries ``` diff --git a/map-map_by_hand/benchmark2.js b/map-map_by_hand/benchmark2.js index ea6df79..c8ee0eb 100644 --- a/map-map_by_hand/benchmark2.js +++ b/map-map_by_hand/benchmark2.js @@ -31,8 +31,5 @@ suite .add('map', a) .add('mapByHand', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/named_function-arrow_function/Makefile b/named_function-arrow_function/Makefile index a478431..45909c8 100644 --- a/named_function-arrow_function/Makefile +++ b/named_function-arrow_function/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-arrow.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-arrow.txt - rm *.log && rm out.txt - node --prof prof-named.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-named.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-arrow' >> README.md - echo '```' >> README.md - cat tick-arrow.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-named' >> README.md - echo '```' >> README.md - cat tick-named.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/named_function-arrow_function/README.md b/named_function-arrow_function/README.md index 7fe08ae..9fbe2d2 100644 --- a/named_function-arrow_function/README.md +++ b/named_function-arrow_function/README.md @@ -3,57 +3,35 @@ ``` named Raw: - > 924.075924075924 - > 926.073926073926 - > 902.0979020979021 - > 898.1018981018981 -Average (mean) 912.5874125874125 + > 910.0899100899101 + > 896.1038961038961 + > 929.0709290709291 + > 925.0749250749251 +Average (mean) 915.0849150849151 arrow Raw: - > 909.0909090909091 - > 879.2415169660678 - > 889.1108891108892 - > 895.2095808383234 -Average (mean) 893.1632240015474 + > 906.187624750499 + > 920.07992007992 + > 879.1208791208791 + > 916.083916083916 +Average (mean) 905.3680850088035 Winner: named Compared with next highest (arrow), it's: -2.13% faster -1.02 times as fast -0.01 order(s) of magnitude faster -A LITTLE FASTER +1.06% faster +1.01 times as fast +0 order(s) of magnitude faster +BASICALLY THE SAME ``` ## Benchmark 2 ``` -named x 903,707 ops/sec ±0.63% (88 runs sampled) -arrow x 902,548 ops/sec ±0.84% (89 runs sampled) -Fastest is: named,arrow -[null] -``` - -## Profile summary - -Tick-arrow -``` - [Summary]: - ticks total nonlib name - 4323 46.1% 46.2% JavaScript - 4417 47.1% 47.2% C++ - 250 2.7% 2.7% GC - 16 0.2% Shared libraries -``` - -Tick-named -``` - [Summary]: - ticks total nonlib name - 4172 44.6% 44.7% JavaScript - 4529 48.4% 48.5% C++ - 230 2.5% 2.5% GC - 17 0.2% Shared libraries + +named x 833,032 ops/sec ±2.65% (81 runs sampled) +arrow x 885,687 ops/sec ±1.18% (89 runs sampled) +Fastest is: arrow ``` diff --git a/named_function-arrow_function/benchmark2.js b/named_function-arrow_function/benchmark2.js index e42a6e8..d46d883 100644 --- a/named_function-arrow_function/benchmark2.js +++ b/named_function-arrow_function/benchmark2.js @@ -32,8 +32,5 @@ suite .add('named', a) .add('arrow', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/object_assign-util_extend/Makefile b/object_assign-util_extend/Makefile index 557c280..33cb57d 100644 --- a/object_assign-util_extend/Makefile +++ b/object_assign-util_extend/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-object_assign.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-assign.txt - rm *.log && rm out.txt - node --prof prof-util_extend.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-extend.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -21,19 +14,6 @@ bench: lint echo ' ' >> README.md echo '```' >> README.md tail -n 4 bench2.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-Assign' >> README.md - echo '```' >> README.md - cat tick-assign.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-Extend' >> README.md - echo '```' >> README.md - cat tick-extend.txt >> README.md - echo '```' >> README.md echo ' ' >> README.md rm *.txt lint: node_modules diff --git a/object_assign-util_extend/README.md b/object_assign-util_extend/README.md index 03d774d..9330d2d 100644 --- a/object_assign-util_extend/README.md +++ b/object_assign-util_extend/README.md @@ -3,25 +3,25 @@ ``` Extend Raw: - > 7789.210789210789 - > 8104.895104895105 - > 8094.905094905095 - > 8235.764235764236 -Average (mean) 8056.193806193806 + > 7161.838161838162 + > 6861.138861138861 + > 7529.470529470529 + > 7611.388611388611 +Average (mean) 7290.95904095904 Assign Raw: - > 5975.024975024975 - > 6209.79020979021 - > 6105.894105894105 - > 6235.764235764236 -Average (mean) 6131.618381618381 + > 5496.5034965034965 + > 5590.40959040959 + > 5486.513486513487 + > 5853.146853146854 +Average (mean) 5606.643356643356 Winner: Extend Compared with next highest (Assign), it's: -23.89% faster -1.31 times as fast -0.12 order(s) of magnitude faster +23.1% faster +1.3 times as fast +0.11 order(s) of magnitude faster A LITTLE FASTER ``` @@ -29,31 +29,8 @@ A LITTLE FASTER ## Benchmark 2 ``` -Assign x 5,565,803 ops/sec ±0.75% (92 runs sampled) -Extend x 7,118,612 ops/sec ±1.34% (85 runs sampled) + +Assign x 5,398,384 ops/sec ±1.34% (90 runs sampled) +Extend x 6,887,591 ops/sec ±1.96% (87 runs sampled) Fastest is: Extend -[null] -``` - -## Profile summary - -Tick-Assign -``` - [Summary]: - ticks total nonlib name - 710 7.6% 7.6% JavaScript - 8025 85.5% 86.4% C++ - 31 0.3% 0.3% GC - 104 1.1% Shared libraries -``` - -Tick-Extend -``` - [Summary]: - ticks total nonlib name - 4157 44.4% 44.9% JavaScript - 4505 48.1% 48.6% C++ - 92 1.0% 1.0% GC - 105 1.1% Shared libraries -``` diff --git a/object_assign-util_extend/benchmark2.js b/object_assign-util_extend/benchmark2.js index beb16f8..fec67ba 100644 --- a/object_assign-util_extend/benchmark2.js +++ b/object_assign-util_extend/benchmark2.js @@ -19,11 +19,8 @@ function extend () { const suite = new Benchmark.Suite(); suite - .add('Assign', assign) - .add('Extend', extend) - .on('cycle', (event) => console.log(String(event.target))) - .on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); - }) - .run(); +.add('Assign', assign) +.add('Extend', extend) +.on('cycle', (event) => console.log(String(event.target))) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) +.run(); diff --git a/reduce-reduce_by_hand/Makefile b/reduce-reduce_by_hand/Makefile index db3ef51..45909c8 100644 --- a/reduce-reduce_by_hand/Makefile +++ b/reduce-reduce_by_hand/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-reduce.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-reduce.txt - rm *.log && rm out.txt - node --prof prof-reduce_by_hand.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-reduce_by_hand.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-reduce' >> README.md - echo '```' >> README.md - cat tick-reduce.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-reduce_by_hand' >> README.md - echo '```' >> README.md - cat tick-reduce_by_hand.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/reduce-reduce_by_hand/README.md b/reduce-reduce_by_hand/README.md index dbb58b0..3337754 100644 --- a/reduce-reduce_by_hand/README.md +++ b/reduce-reduce_by_hand/README.md @@ -3,25 +3,25 @@ ``` reducee Raw: - > 7946.053946053946 - > 7805.194805194805 - > 7785.2147852147855 - > 7934.065934065934 -Average (mean) 7867.632367632367 + > 7857.142857142857 + > 7994.005994005994 + > 7635.364635364635 + > 7950.04995004995 +Average (mean) 7859.140859140859 reduceByHand Raw: - > 6780.219780219781 - > 6664.335664335665 - > 6519.480519480519 - > 6754.245754245754 -Average (mean) 6679.570429570429 + > 6250.749250749251 + > 6669.3306693306695 + > 6728.2717282717285 + > 6172.827172827173 +Average (mean) 6455.294705294705 Winner: reducee Compared with next highest (reduceByHand), it's: -15.1% faster -1.18 times as fast -0.07 order(s) of magnitude faster +17.86% faster +1.22 times as fast +0.09 order(s) of magnitude faster A LITTLE FASTER ``` @@ -29,31 +29,9 @@ A LITTLE FASTER ## Benchmark 2 ``` -reduce x 6,932,332 ops/sec ±0.83% (90 runs sampled) -reduceByHand x 6,288,599 ops/sec ±0.90% (88 runs sampled) + +reduce x 7,323,182 ops/sec ±1.10% (88 runs sampled) +reduceByHand x 6,174,494 ops/sec ±1.47% (84 runs sampled) Fastest is: reduce -[null] -``` - -## Profile summary - -Tick-reduce -``` - [Summary]: - ticks total nonlib name - 7870 84.0% 85.0% JavaScript - 719 7.7% 7.8% C++ - 618 6.6% 6.7% GC - 105 1.1% Shared libraries -``` - -Tick-reduce_by_hand -``` - [Summary]: - ticks total nonlib name - 8905 95.3% 95.9% JavaScript - 184 2.0% 2.0% C++ - 1 0.0% 0.0% GC - 67 0.7% Shared libraries ``` diff --git a/reduce-reduce_by_hand/benchmark2.js b/reduce-reduce_by_hand/benchmark2.js index 0f5c968..5151eee 100644 --- a/reduce-reduce_by_hand/benchmark2.js +++ b/reduce-reduce_by_hand/benchmark2.js @@ -31,8 +31,5 @@ suite .add('reduce', a) .add('reduceByHand', b) .on('cycle', (event) => console.log(String(event.target))) -.on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); -}) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) .run(); diff --git a/weakmap-symbol/Makefile b/weakmap-symbol/Makefile index 4caf5dc..45909c8 100644 --- a/weakmap-symbol/Makefile +++ b/weakmap-symbol/Makefile @@ -3,14 +3,7 @@ bench: lint tail -n 23 out.txt > bench.txt rm out.txt npm run benchmark2 > bench2.txt - node --prof prof-weakmap.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-weakmap.txt - rm *.log && rm out.txt - node --prof prof-symbol.js > /dev/null - node --prof-process *.log > out.txt - grep -A 5 "Summary" -R out.txt > tick-symbol.txt - rm *.log && rm out.txt && touch README.md && rm README.md + touch README.md && rm README.md echo '## Benchmark' >> README.md echo ' ' >> README.md echo '```' >> README.md @@ -23,18 +16,6 @@ bench: lint tail -n 4 bench2.txt >> README.md echo '```' >> README.md echo ' ' >> README.md - echo '## Profile summary' >> README.md - echo ' ' >> README.md - echo 'Tick-Weakmap' >> README.md - echo '```' >> README.md - cat tick-weakmap.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md - echo 'Tick-Symbol' >> README.md - echo '```' >> README.md - cat tick-symbol.txt >> README.md - echo '```' >> README.md - echo ' ' >> README.md rm *.txt lint: node_modules npm run lint diff --git a/weakmap-symbol/README.md b/weakmap-symbol/README.md index ff10044..ccbc525 100644 --- a/weakmap-symbol/README.md +++ b/weakmap-symbol/README.md @@ -3,24 +3,24 @@ ``` Symbol Raw: - > 137713.2867132867 - > 138199.8001998002 - > 132657.34265734267 - > 135792.2077922078 -Average (mean) 136090.65934065936 + > 138717.2827172827 + > 144693.3066933067 + > 137625.37462537462 + > 142539.46053946053 +Average (mean) 140893.85614385613 WeakMap Raw: - > 1750.2497502497502 - > 343.701399688958 - > 1559.659090909091 - > 1476.4107308048103 -Average (mean) 1282.5052429131524 + > 1822.1778221778222 + > 423.1927710843373 + > 1623.3766233766235 + > 1351.0324483775812 +Average (mean) 1304.9449162540911 Winner: Symbol Compared with next highest (WeakMap), it's: -99.06% faster -106.11 times as fast +99.07% faster +107.97 times as fast 2.03 order(s) of magnitude faster A LOT FASTER @@ -29,31 +29,9 @@ A LOT FASTER ## Benchmark 2 ``` -WeakMap x 1,137,180 ops/sec ±39.06% (41 runs sampled) -Symbol x 88,229,311 ops/sec ±1.62% (82 runs sampled) + +WeakMap x 1,047,911 ops/sec ±42.83% (38 runs sampled) +Symbol x 87,499,995 ops/sec ±1.51% (85 runs sampled) Fastest is: Symbol -[null] -``` - -## Profile summary - -Tick-Weakmap -``` - [Summary]: - ticks total nonlib name - 1247 12.1% 12.2% JavaScript - 8669 84.4% 84.7% C++ - 4696 45.7% 45.9% GC - 38 0.4% Shared libraries -``` - -Tick-Symbol -``` - [Summary]: - ticks total nonlib name - 6787 72.4% 86.3% JavaScript - 385 4.1% 4.9% C++ - 8 0.1% 0.1% GC - 1508 16.1% Shared libraries ``` diff --git a/weakmap-symbol/benchmark2.js b/weakmap-symbol/benchmark2.js index a6fb743..b82d2d9 100644 --- a/weakmap-symbol/benchmark2.js +++ b/weakmap-symbol/benchmark2.js @@ -40,11 +40,8 @@ function b () { } suite - .add('WeakMap', a) - .add('Symbol', b) - .on('cycle', (event) => console.log(String(event.target))) - .on('complete', () => { - console.log(`Fastest is: ${suite.filter('fastest').map('name')}`); - console.log(`[${Benchmark.platform.description}]`); - }) - .run(); +.add('WeakMap', a) +.add('Symbol', b) +.on('cycle', (event) => console.log(String(event.target))) +.on('complete', () => console.log(`Fastest is: ${suite.filter('fastest').map('name')}`)) +.run();