Skip to content

Commit

Permalink
clarify benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
samthor committed Apr 28, 2020
1 parent 79025b6 commit 336416a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bench/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Benchmark code.
Benchmark code for Node.
Usage:

```bash
Expand All @@ -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):
Expand Down

0 comments on commit 336416a

Please sign in to comment.