From 336416a6c4ac311b7e4193308798cfdcaf29d36d Mon Sep 17 00:00:00 2001 From: Sam Thorogood Date: Tue, 28 Apr 2020 15:28:53 +1000 Subject: [PATCH] clarify benchmark --- bench/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bench/README.md b/bench/README.md index 167a8b7..b337c71 100644 --- a/bench/README.md +++ b/bench/README.md @@ -1,4 +1,4 @@ -Benchmark code. +Benchmark code for Node. Usage: ```bash @@ -16,6 +16,14 @@ This is an odd number, but we're comparing the on-disk UTF-8 bytes (which optimi All Unicode code points can be represented as either one or two "lengths" of a JavaScript string, but each code point can be between 1-4 bytes in UTF-8. The possible ratios therefore range from 0.25 (e.g., all emoji) through 1.0 (e.g., ASCII). +# Options + +By default, the benchmark tool disables and removes native-like implementations in Node. +It removes `Buffer` plus the native `TextEncoder` and `TextDecoder` from the global scope. + +Use `--native` to enable support for them. +This will speed up `fast-text-encoding`, as it uses `Buffer` when available. + # Results For the suggested text on my test rig (macOS 3.6GHz i9), output looks like (snipped):