@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.
Files changed (2) hide show
  1. package/README.md +20 -7
  2. 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 32% faster than `clsx/lite`
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
- | Test Case | @lightsound/cn | clsx/lite | Improvement |
36
- | --------- | -------------- | --------- | ----------- |
37
- | 2 strings | 34.89 ns | 51.66 ns | **32% faster** |
38
- | 3 strings | 52.59 ns | 67.13 ns | **22% faster** |
39
- | 5 strings | 66.69 ns | 86.46 ns | **23% faster** |
40
- | 10 strings | 110.42 ns | 153.52 ns | **28% faster** |
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsound/cn",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A tiny, blazing fast utility for constructing className strings conditionally",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",