From 7f453ca1f25db3ee2212853e741ba31e99ebd99f Mon Sep 17 00:00:00 2001 From: JounQin Date: Tue, 26 Dec 2023 23:55:54 +0800 Subject: [PATCH] docs: update benchmark --- README.md | 4 ++-- benchmarks/benchmark.cjs.txt | 6 +++--- benchmarks/benchmark.esm.txt | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5744efbe9..d2524c38a 100644 --- a/README.md +++ b/README.md @@ -154,9 +154,9 @@ Please view [`tsx`][] for its document ## Benchmark -It is about 20x faster than [`sync-threads`](https://github.com/lambci/sync-threads) but 3x slower than native for reading the file content itself 1000 times during runtime, and 18x faster than `sync-threads` but 4x slower than native for total time. +It is about 50x faster than [`sync-threads`](https://github.com/lambci/sync-threads) but 10x slower than native for reading the file content itself 1000 times during runtime, and 40x faster than `sync-threads` but 10x slower than native for total time on my personal MacBook Pro with 64G M1 Max. -And it's almost same as [`deasync`](https://github.com/abbr/deasync) but requires no native bindings or `node-gyp`. +And it's almost 5x faster than [`deasync`](https://github.com/abbr/deasync) but requires no native bindings or `node-gyp`. See [benchmark.cjs](./benchmarks/benchmark.cjs.txt) and [benchmark.esm](./benchmarks/benchmark.esm.txt) for more details. diff --git a/benchmarks/benchmark.cjs.txt b/benchmarks/benchmark.cjs.txt index 575d734c9..59b081df3 100644 --- a/benchmarks/benchmark.cjs.txt +++ b/benchmarks/benchmark.cjs.txt @@ -2,7 +2,7 @@ $ node benchmarks/benchmark.cjs ┌───────────┬────────────┬──────────────┬───────────────────┬────────────┬────────────────┬───────────┬─────────────────┐ │ (index) │ synckit │ sync-threads │ perf sync-threads │ deasync │ perf deasync │ native │ perf native │ ├───────────┼────────────┼──────────────┼───────────────────┼────────────┼────────────────┼───────────┼─────────────────┤ -│ loadTime │ '13.13ms' │ '2.05ms' │ '6.42x slower' │ '9.73ms' │ '1.35x slower' │ '0.45ms' │ '29.50x slower' │ -│ runTime │ '288.46ms' │ '6167.96ms' │ '21.38x faster' │ '323.32ms' │ '1.12x faster' │ '44.70ms' │ '6.45x slower' │ -│ totalTime │ '301.59ms' │ '6170.01ms' │ '20.46x faster' │ '333.06ms' │ '1.10x faster' │ '45.15ms' │ '6.68x slower' │ +│ loadTime │ '9.01ms' │ '0.80ms' │ '11.29x slower' │ '20.32ms' │ '2.26x faster' │ '0.37ms' │ '24.37x slower' │ +│ runTime │ '109.97ms' │ '5166.40ms' │ '46.98x faster' │ '557.75ms' │ '5.07x faster' │ '10.56ms' │ '10.41x slower' │ +│ totalTime │ '118.98ms' │ '5167.20ms' │ '43.43x faster' │ '578.07ms' │ '4.86x faster' │ '10.93ms' │ '10.88x slower' │ └───────────┴────────────┴──────────────┴───────────────────┴────────────┴────────────────┴───────────┴─────────────────┘ diff --git a/benchmarks/benchmark.esm.txt b/benchmarks/benchmark.esm.txt index e0f351efa..5a80af049 100644 --- a/benchmarks/benchmark.esm.txt +++ b/benchmarks/benchmark.esm.txt @@ -2,7 +2,7 @@ $ node benchmarks/benchmark.js ┌───────────┬────────────┬──────────────┬───────────────────┬────────────┬────────────────┬───────────┬─────────────────┐ │ (index) │ synckit │ sync-threads │ perf sync-threads │ deasync │ perf deasync │ native │ perf native │ ├───────────┼────────────┼──────────────┼───────────────────┼────────────┼────────────────┼───────────┼─────────────────┤ -│ loadTime │ '29.26ms' │ '2.26ms' │ '12.92x slower' │ '17.44ms' │ '1.68x slower' │ '1.02ms' │ '28.72x slower' │ -│ runTime │ '286.99ms' │ '5520.70ms' │ '19.24x faster' │ '398.49ms' │ '1.39x faster' │ '47.83ms' │ '6.00x slower' │ -│ totalTime │ '316.24ms' │ '5522.96ms' │ '17.46x faster' │ '415.93ms' │ '1.32x faster' │ '48.85ms' │ '6.47x slower' │ +│ loadTime │ '16.97ms' │ '1.04ms' │ '16.37x slower' │ '9.67ms' │ '1.76x slower' │ '0.56ms' │ '30.19x slower' │ +│ runTime │ '122.19ms' │ '4970.21ms' │ '40.67x faster' │ '633.51ms' │ '5.18x faster' │ '10.47ms' │ '11.67x slower' │ +│ totalTime │ '139.16ms' │ '4971.25ms' │ '35.72x faster' │ '643.18ms' │ '4.62x faster' │ '11.03ms' │ '12.61x slower' │ └───────────┴────────────┴──────────────┴───────────────────┴────────────┴────────────────┴───────────┴─────────────────┘