Skip to content
Myr

readme.md

This file

Path

bench/readme.md

61 lines · 2.3 KiB · Markdown

Last changed by

feat: add `clsx/lite` moduleLuke Edwardsbefore adoption1a49142

History of this file

Take it

chore: add benchmarks with screenshotsLuke Edwardsbefore adoptionfc852c8

lines 1–2why, one step back
1## Benchmarks
2

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 3–6why, one step back
3> Below you will find benchmark results for [Node.js](#Node) and [multiple browser](#Browsers) engines.
45## Node6

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

line 7why, one step back
7These are the results while running this directory's benchmark suite in Node v20.10.0.

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 8–12why, one step back
8
9> **Note:** The `≠` denotes that the candidate has a different API and is not compatible with `classnames` usage.1011```12# Strings

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 13why, one step back
13 classcat ≠ x 9,613,381 ops/sec ±0.16% (94 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 14–15why, one step back
14 classnames x 6,540,072 ops/sec ±0.11% (101 runs sampled)
15 clsx x 12,924,662 ops/sec ±0.15% (102 runs sampled)

feat: add `clsx/lite` moduleLuke Edwardsbefore adoption1a49142

line 16why, one step back
16 clsx/lite x 13,122,004 ops/sec ±0.40% (99 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 17–18why, one step back
17
18# Objects

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 19why, one step back
19 classcat ≠ x 8,936,903 ops/sec ±0.12% (100 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 20–21why, one step back
20 classnames x 6,143,319 ops/sec ±0.14% (100 runs sampled)
21 clsx x 9,444,110 ops/sec ±0.11% (102 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 22–23why, one step back
22
23# Arrays

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 24why, one step back
24 classcat ≠ x 8,247,121 ops/sec ±0.12% (98 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 25–26why, one step back
25 classnames x 3,451,489 ops/sec ±0.18% (99 runs sampled)
26 clsx x 9,401,030 ops/sec ±0.18% (101 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 27–28why, one step back
27
28# Nested Arrays

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 29why, one step back
29 classcat ≠ x 6,759,204 ops/sec ±0.31% (97 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 30–31why, one step back
30 classnames x 2,015,566 ops/sec ±0.18% (100 runs sampled)
31 clsx x 7,315,032 ops/sec ±0.43% (99 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 32–33why, one step back
32
33# Nested Arrays w/ Objects

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 34why, one step back
34 classcat ≠ x 6,726,315 ops/sec ±0.16% (98 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 35–36why, one step back
35 classnames x 3,059,235 ops/sec ±0.45% (99 runs sampled)
36 clsx x 7,352,761 ops/sec ±0.44% (98 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 37–38why, one step back
37
38# Mixed

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 39why, one step back
39 classcat ≠ x 6,956,920 ops/sec ±0.21% (97 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 40–41why, one step back
40 classnames x 4,171,381 ops/sec ±0.15% (98 runs sampled)
41 clsx x 8,468,116 ops/sec ±0.11% (96 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 42–43why, one step back
42
43# Mixed (Bad Data)

chore(bench): include ≠ symbolLuke Edwardsbefore adoption855eec2

line 44why, one step back
44 classcat ≠ x 2,128,702 ops/sec ±0.13% (101 runs sampled)

chore: update benchmarks;Luke Edwardsbefore adoption6e3b2b9

lines 45–46why, one step back
45 classnames x 1,925,670 ops/sec ±0.19% (100 runs sampled)
46 clsx x 2,996,516 ops/sec ±0.07% (100 runs sampled)

chore: benchmark resultsLuke Edwardsbefore adoption8d5a2f7

lines 47–50why, one step back
47```
4849## Browsers50

chore: add benchmarks with screenshotsLuke Edwardsbefore adoptionfc852c8

lines 51–56why, one step back
51Results are taken from the [benchmark suite](https://github.com/JedWatson/classnames/tree/master/benchmarks) within the `classnames` repository.
5253These were run in a clean environment and on 4GHz i7 with 32GB of RAM. As you can see, results _will_ vary from browser to browser – multiple results were included for quick viewing.5455---56

chore: enlarge benchmark imagesLuke Edwardsbefore adoptione90faa6

lines 57–61why, one step back
57<p align="center">
58 <img src="chrome.png" width="70%" alt="chrome" />59 <img src="firefox.png" width="70%" alt="firefox" />60 <img src="safari.png" width="70%" alt="safari" />61</p>