@lightsound/cn 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A tiny, **blazing fast** utility for constructing `className` strings conditiona
|
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
|
-
- **Blazing Fast**: Up to
|
|
12
|
+
- **Blazing Fast**: Up to 50% faster than `clsx/lite`
|
|
13
13
|
- **Tiny**: ~130B gzipped (smaller than clsx/lite!)
|
|
14
14
|
- **TypeScript**: Full type support out of the box
|
|
15
15
|
- **Simple API**: Strings only - no objects, no arrays, maximum performance
|
|
@@ -32,14 +32,27 @@ If you only use string-based class composition (the most common pattern with Tai
|
|
|
32
32
|
> Benchmarks are run on every CI build. See the [latest CI run](https://github.com/lightsound/cn/actions/workflows/ci.yml) for up-to-date results.
|
|
33
33
|
|
|
34
34
|
<!-- BENCHMARK_START -->
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
35
|
+
|
|
36
|
+
| Test Case | @lightsound/cn | clsx/lite | Improvement |
|
|
37
|
+
| ---------- | -------------- | --------- | -------------- |
|
|
38
|
+
| 2 strings | 20.76 ns | 41.56 ns | **50% faster** |
|
|
39
|
+
| 3 strings | 47.25 ns | 62.71 ns | **25% faster** |
|
|
40
|
+
| 5 strings | 62.90 ns | 83.75 ns | **25% faster** |
|
|
41
|
+
| 10 strings | 104.68 ns | 135.50 ns | **23% faster** |
|
|
42
|
+
|
|
41
43
|
<!-- BENCHMARK_END -->
|
|
42
44
|
|
|
45
|
+
<details>
|
|
46
|
+
<summary>Benchmark methodology</summary>
|
|
47
|
+
|
|
48
|
+
- **Runs**: 30 iterations per scenario
|
|
49
|
+
- **Iterations**: 100,000 operations per run
|
|
50
|
+
- **Outlier removal**: Top and bottom 10% trimmed
|
|
51
|
+
- **Metric**: Median (more stable than mean)
|
|
52
|
+
- **Warmup**: 10,000 iterations before measurement
|
|
53
|
+
|
|
54
|
+
</details>
|
|
55
|
+
|
|
43
56
|
## Installation
|
|
44
57
|
|
|
45
58
|
```bash
|