@medicomind/rolldown-compression 2.1.1 → 2.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @medicomind/rolldown-compression
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6e0b693`](https://github.com/Medico-Mind/rolldown-compression/commit/6e0b693fd24338102876ecb4bb605ed37e1a3804) Thanks [@Mnwa](https://github.com/Mnwa)! - Default brotli `sectionSize` to one window (`2^windowBits` bytes) instead of a fixed 4 MiB, so a custom `windowBits` gets a matching section size. Unchanged at the default window of 22, where both are 4 MiB.
8
+
3
9
  ## 2.1.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -104,7 +104,7 @@ All options are validated when `compression()` is called — invalid levels (e.g
104
104
  | `gzip` | `level` | 0–9 | 6 |
105
105
  | `brotli` | `quality` | 0–11 | 11 |
106
106
  | `brotli` | `windowBits` | 10–24 | 22 |
107
- | `brotli` | `sectionSize` | ≥ 1 (bytes) | 4 MiB |
107
+ | `brotli` | `sectionSize` | ≥ 1 (bytes) | `2^windowBits` B |
108
108
  | `zstd` | `level` | 1–22 | 19 |
109
109
 
110
110
  ```ts
@@ -113,7 +113,7 @@ defineAlgorithm('brotli', { quality: 7, windowBits: 22 })
113
113
  defineAlgorithm('zstd', { level: 12 })
114
114
  ```
115
115
 
116
- `sectionSize` is the target number of bytes each brotli worker thread compresses when a large input is split across the native worker pool; inputs at least four times `sectionSize` take the multithreaded path (16 MiB at the default). Smaller sections finish large files faster at a slight cost in compression ratio — sections much smaller than the window (`2^windowBits` bytes) lose too many cross-section matches.
116
+ `sectionSize` is the target number of bytes each brotli worker thread compresses when a large input is split across the native worker pool; inputs at least four times `sectionSize` take the multithreaded path. It defaults to one window (`2^windowBits` bytes) — 4 MiB and multithreading from 16 MiB at the default window — because sections much smaller than the window lose too many cross-section matches. Smaller sections finish large files faster at a slight cost in compression ratio.
117
117
 
118
118
  ## How it works
119
119
 
package/dist/index.d.cts CHANGED
@@ -12,9 +12,9 @@ interface GzipOptions {
12
12
  * Brotli options. `quality`: 0-11, default 11. `windowBits`: 10-24, default 22.
13
13
  * `sectionSize`: target bytes per worker thread when large inputs are split
14
14
  * across the native brotli worker pool; inputs at least four times this size
15
- * take the multithreaded path. Default 4 MiB (multithreading from 16 MiB).
16
- * Smaller sections finish large files faster at a slight cost in compression
17
- * ratio.
15
+ * take the multithreaded path. Defaults to one window (`2^windowBits` bytes),
16
+ * i.e. 4 MiB and multithreading from 16 MiB at the default window. Smaller
17
+ * sections finish large files faster at a slight cost in compression ratio.
18
18
  */
19
19
  interface BrotliOptions {
20
20
  quality?: number;
package/dist/index.d.mts CHANGED
@@ -12,9 +12,9 @@ interface GzipOptions {
12
12
  * Brotli options. `quality`: 0-11, default 11. `windowBits`: 10-24, default 22.
13
13
  * `sectionSize`: target bytes per worker thread when large inputs are split
14
14
  * across the native brotli worker pool; inputs at least four times this size
15
- * take the multithreaded path. Default 4 MiB (multithreading from 16 MiB).
16
- * Smaller sections finish large files faster at a slight cost in compression
17
- * ratio.
15
+ * take the multithreaded path. Defaults to one window (`2^windowBits` bytes),
16
+ * i.e. 4 MiB and multithreading from 16 MiB at the default window. Smaller
17
+ * sections finish large files faster at a slight cost in compression ratio.
18
18
  */
19
19
  interface BrotliOptions {
20
20
  quality?: number;
package/index.d.ts CHANGED
@@ -56,8 +56,9 @@ export interface CompressTask {
56
56
  /**
57
57
  * Brotli only: target section size in bytes per worker thread when
58
58
  * large inputs are split across the brotli worker pool; inputs at
59
- * least four times this size take the multithreaded path
60
- * (default 4 MiB, i.e. multithreading from 16 MiB).
59
+ * least four times this size take the multithreaded path. Defaults
60
+ * to one window (`2^windowBits` bytes), i.e. 4 MiB and
61
+ * multithreading from 16 MiB at the default window.
61
62
  */
62
63
  sectionSize?: number
63
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medicomind/rolldown-compression",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Fast native (Rust) gzip / brotli / zstd compression plugin for Rolldown, powered by napi-rs",
5
5
  "keywords": [
6
6
  "rolldown",
@@ -91,13 +91,13 @@
91
91
  "rolldown": "^1.0.0"
92
92
  },
93
93
  "optionalDependencies": {
94
- "@medicomind/rolldown-compression-darwin-arm64": "2.1.1",
95
- "@medicomind/rolldown-compression-darwin-x64": "2.1.1",
96
- "@medicomind/rolldown-compression-linux-arm64-gnu": "2.1.1",
97
- "@medicomind/rolldown-compression-linux-x64-gnu": "2.1.1",
98
- "@medicomind/rolldown-compression-linux-x64-musl": "2.1.1",
99
- "@medicomind/rolldown-compression-wasm32-wasi": "2.1.1",
100
- "@medicomind/rolldown-compression-win32-x64-msvc": "2.1.1"
94
+ "@medicomind/rolldown-compression-darwin-arm64": "2.1.2",
95
+ "@medicomind/rolldown-compression-darwin-x64": "2.1.2",
96
+ "@medicomind/rolldown-compression-linux-arm64-gnu": "2.1.2",
97
+ "@medicomind/rolldown-compression-linux-x64-gnu": "2.1.2",
98
+ "@medicomind/rolldown-compression-linux-x64-musl": "2.1.2",
99
+ "@medicomind/rolldown-compression-wasm32-wasi": "2.1.2",
100
+ "@medicomind/rolldown-compression-win32-x64-msvc": "2.1.2"
101
101
  },
102
102
  "devDependencies": {
103
103
  "@biomejs/biome": "^2.5.3",