smol-toml 1.7.0 โ 1.7.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/README.md +190 -192
- package/dist/date.d.ts +0 -1
- package/dist/date.js +0 -1
- package/dist/error.d.ts +1 -2
- package/dist/error.js +3 -2
- package/dist/extract.js +33 -65
- package/dist/index.cjs +286 -266
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/parse.d.ts +1 -3
- package/dist/parse.js +22 -21
- package/dist/primitive.js +77 -76
- package/dist/stringify.d.ts +0 -1
- package/dist/stringify.js +0 -1
- package/dist/struct.js +93 -93
- package/dist/util.d.ts +1 -5
- package/dist/util.js +40 -37
- package/package.json +12 -9
- package/dist/date.d.ts.map +0 -1
- package/dist/date.js.map +0 -1
- package/dist/error.d.ts.map +0 -1
- package/dist/error.js.map +0 -1
- package/dist/extract.d.ts +0 -31
- package/dist/extract.d.ts.map +0 -1
- package/dist/extract.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/parse.d.ts.map +0 -1
- package/dist/parse.js.map +0 -1
- package/dist/primitive.d.ts +0 -32
- package/dist/primitive.d.ts.map +0 -1
- package/dist/primitive.js.map +0 -1
- package/dist/stringify.d.ts.map +0 -1
- package/dist/stringify.js.map +0 -1
- package/dist/struct.d.ts +0 -33
- package/dist/struct.d.ts.map +0 -1
- package/dist/struct.js.map +0 -1
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js.map +0 -1
- package/src/date.ts +0 -152
- package/src/error.ts +0 -77
- package/src/extract.ts +0 -112
- package/src/index.ts +0 -42
- package/src/parse.ts +0 -184
- package/src/primitive.ts +0 -247
- package/src/stringify.ts +0 -191
- package/src/struct.ts +0 -199
- package/src/util.ts +0 -101
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# smol-toml
|
|
2
2
|
[](https://toml.io/en/v1.1.0)
|
|
3
3
|
[](https://github.com/squirrelchat/smol-toml/blob/mistress/LICENSE)
|
|
4
|
-
[](https://
|
|
4
|
+
[](https://npmx.dev/smol-toml)
|
|
5
5
|
[](https://github.com/squirrelchat/smol-toml/actions/workflows/build.yaml)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/sponsors/cyyynthia)
|
|
8
|
-
[](https://
|
|
9
|
-
[](https://
|
|
8
|
+
[](https://npmx.dev/smol-toml)
|
|
9
|
+
[](https://npmx.dev/smol-toml)
|
|
10
10
|
|
|
11
11
|
A small, fast, and correct TOML parser and serializer. smol-toml is fully(ish) spec-compliant with TOML v1.1.0.
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ console.log(toml)
|
|
|
54
54
|
|
|
55
55
|
Alternatively, if you prefer something similar to the JSON global, you can import the library as follows
|
|
56
56
|
```js
|
|
57
|
-
import TOML from 'smol-toml'
|
|
57
|
+
import * as TOML from 'smol-toml'
|
|
58
58
|
|
|
59
59
|
TOML.stringify({ ... })
|
|
60
60
|
```
|
|
@@ -154,15 +154,15 @@ While `fast-toml` is included as it's a challenging candidate, it takes a lot of
|
|
|
154
154
|
but at the expense of correctness (it has significant defects and does not pass the TOML test suite). `smol-toml` is
|
|
155
155
|
almost as fast, without sacrificing correctness. ๐
|
|
156
156
|
|
|
157
|
-
| **Parse** | smol-toml@1.7.
|
|
158
|
-
|
|
159
|
-
| Spec example | **4.
|
|
160
|
-
| ~5MB test file |
|
|
157
|
+
| **Parse** | smol-toml@1.7.2 | @iarna/toml@3.0.0 | @ltd/j-toml@1.38.0 | fast-toml@0.5.4 | @std/toml@1.0.11 | toml@5.0.0 | js-toml@2.0.1 | @decimalturn/toml-patch@3.0.2 |
|
|
158
|
+
|----------------|--------------------|-------------------|--------------------|-------------------|------------------|----------------|----------------|-------------------------------|
|
|
159
|
+
| Spec example | **4.16 ยตs/iter** | 12.13 ยตs/iter | 30.44 ยตs/iter | 5.01 ยตs/iter | 22.34 ยตs/iter | 32.28 ยตs/iter | 24.71 ยตs/iter | 17.07 ยตs/iter |
|
|
160
|
+
| ~5MB test file | *113.76 ms/iter* | *DNF* | 189.89 ms/iter | **92.24 ms/iter** | 419.95 ms/iter | 549.86 ms/iter | 336.03 ms/iter | 186.32 ms/iter |
|
|
161
161
|
|
|
162
|
-
| **Stringify** | smol-toml@1.7.
|
|
162
|
+
| **Stringify** | smol-toml@1.7.2 | @iarna/toml@3.0.0 | @ltd/j-toml@1.38.0 | fast-toml@0.5.4 | @std/toml@1.0.11 | toml@5.0.0 | js-toml@2.0.1 | @decimalturn/toml-patch@3.0.2 |
|
|
163
163
|
|----------------|--------------------|-------------------|--------------------|-----------------|------------------|----------------|----------------|-------------------------------|
|
|
164
|
-
| Spec example | **2.
|
|
165
|
-
| ~5MB test file | **
|
|
164
|
+
| Spec example | **2.29 ยตs/iter** | 8.58 ยตs/iter | 89.59 ยตs/iter | N/A | 3.96 ยตs/iter | N/A | 3.69 ยตs/iter | N/A[^toml-patch-note] |
|
|
165
|
+
| ~5MB test file | **45.33 ms/iter** | 130.01 ms/iter | 928.19 ms/iter | N/A | 68.58 ms/iter | N/A | 110.26 ms/iter | N/A[^toml-patch-note] |
|
|
166
166
|
|
|
167
167
|
[^toml-patch-note]: Stringify performance is not included here, as the library is not meant to be fast, but rather
|
|
168
168
|
capable of doing precise non-destructive edits that preserve the entire document's shape and format. Putting it here
|
|
@@ -173,79 +173,79 @@ wouldn't be fair.
|
|
|
173
173
|
|
|
174
174
|
```
|
|
175
175
|
node --expose-gc bench/parse.bench.ts
|
|
176
|
-
clk: ~5.
|
|
176
|
+
clk: ~5.52 GHz
|
|
177
177
|
cpu: AMD Ryzen 9 9950X3D 16-Core Processor
|
|
178
|
-
runtime: node 26.
|
|
178
|
+
runtime: node 26.5.0 (x64-linux)
|
|
179
179
|
|
|
180
180
|
benchmark avg (min โฆ max) p75 / p99 (min โฆ top 1%)
|
|
181
181
|
------------------------------------------- -------------------------------
|
|
182
182
|
โข spec document
|
|
183
183
|
------------------------------------------- -------------------------------
|
|
184
|
-
smol-toml 4.
|
|
185
|
-
(
|
|
186
|
-
(
|
|
187
|
-
4.01 ipc ( 99.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
@iarna/toml 12.
|
|
191
|
-
(11.
|
|
192
|
-
(
|
|
193
|
-
3.97 ipc ( 99.
|
|
194
|
-
68.
|
|
195
|
-
|
|
196
|
-
@ltd/j-toml
|
|
197
|
-
(
|
|
198
|
-
(
|
|
199
|
-
3.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
fast-toml
|
|
203
|
-
(4.
|
|
204
|
-
(
|
|
205
|
-
4.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
deno's @std/toml 22.
|
|
209
|
-
(
|
|
210
|
-
(
|
|
211
|
-
3.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
node-toml
|
|
215
|
-
(
|
|
216
|
-
(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
js-toml
|
|
221
|
-
(
|
|
222
|
-
(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
@decimalturn/toml-patch 17.
|
|
227
|
-
(
|
|
228
|
-
(
|
|
229
|
-
3.
|
|
230
|
-
|
|
184
|
+
smol-toml 4.16 ยตs/iter 4.14 ยตs โ
|
|
185
|
+
(3.99 ยตs โฆ 91.94 ยตs) 4.95 ยตs โโโ
|
|
186
|
+
( 1.41 kb โฆ 417.70 kb) 9.63 kb โโโโโ
โโโโโโโโโโโโโโโโ
|
|
187
|
+
4.01 ipc ( 99.54% cache) 19.70 branch misses
|
|
188
|
+
23.81k cycles 95.44k instructions 3.05k c-refs 14.12 c-misses
|
|
189
|
+
|
|
190
|
+
@iarna/toml 12.13 ยตs/iter 12.04 ยตs โ
|
|
191
|
+
(11.59 ยตs โฆ 133.43 ยตs) 15.94 ยตs โโ
|
|
192
|
+
( 0.00 b โฆ 677.01 kb) 24.08 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
193
|
+
3.97 ipc ( 99.63% cache) 75.32 branch misses
|
|
194
|
+
68.16k cycles 270.90k instructions 10.39k c-refs 38.82 c-misses
|
|
195
|
+
|
|
196
|
+
@ltd/j-toml 30.44 ยตs/iter 29.57 ยตs โ
|
|
197
|
+
(28.19 ยตs โฆ 1.18 ms) 44.30 ยตs โโ
|
|
198
|
+
(432.00 b โฆ 692.05 kb) 27.57 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
199
|
+
3.42 ipc ( 99.37% cache) 284.51 branch misses
|
|
200
|
+
169.50k cycles 579.61k instructions 25.59k c-refs 162.02 c-misses
|
|
201
|
+
|
|
202
|
+
fast-toml 5.01 ยตs/iter 4.98 ยตs โโ
|
|
203
|
+
(4.75 ยตs โฆ 90.47 ยตs) 5.84 ยตs โโโ
|
|
204
|
+
(336.00 b โฆ 302.06 kb) 12.56 kb โโ
โโโโโ
โโโโโโโโโโโโโโ
|
|
205
|
+
4.40 ipc ( 99.53% cache) 25.73 branch misses
|
|
206
|
+
28.21k cycles 124.23k instructions 3.76k c-refs 17.82 c-misses
|
|
207
|
+
|
|
208
|
+
deno's @std/toml 22.34 ยตs/iter 22.15 ยตs โโ
|
|
209
|
+
(20.78 ยตs โฆ 155.43 ยตs) 36.68 ยตs โโ
|
|
210
|
+
( 1.52 kb โฆ 547.05 kb) 64.73 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
211
|
+
3.80 ipc ( 99.53% cache) 111.24 branch misses
|
|
212
|
+
124.05k cycles 471.06k instructions 21.13k c-refs 100.20 c-misses
|
|
213
|
+
|
|
214
|
+
node-toml 32.28 ยตs/iter 31.78 ยตs โ
|
|
215
|
+
(30.33 ยตs โฆ 221.49 ยตs) 53.65 ยตs โ
|
|
216
|
+
( 2.00 kb โฆ 968.27 kb) 109.52 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
217
|
+
3.89 ipc ( 99.18% cache) 193.02 branch misses
|
|
218
|
+
178.72k cycles 695.61k instructions 29.40k c-refs 240.75 c-misses
|
|
219
|
+
|
|
220
|
+
js-toml 24.71 ยตs/iter 23.17 ยตs โ
โ
|
|
221
|
+
(21.20 ยตs โฆ 731.20 ยตs) 39.47 ยตs โโ
|
|
222
|
+
(744.00 b โฆ 861.36 kb) 92.95 kb โโโโ
โโโโโโโโโโโโโโโโโ
|
|
223
|
+
3.79 ipc ( 98.12% cache) 205.75 branch misses
|
|
224
|
+
134.81k cycles 510.43k instructions 19.00k c-refs 357.65 c-misses
|
|
225
|
+
|
|
226
|
+
@decimalturn/toml-patch 17.07 ยตs/iter 16.85 ยตs โโ
|
|
227
|
+
(15.93 ยตs โฆ 224.97 ยตs) 23.30 ยตs โโ
|
|
228
|
+
(632.00 b โฆ 635.14 kb) 55.51 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
229
|
+
3.56 ipc ( 99.37% cache) 73.96 branch misses
|
|
230
|
+
95.58k cycles 339.88k instructions 18.52k c-refs 116.43 c-misses
|
|
231
231
|
|
|
232
232
|
summary
|
|
233
|
-
|
|
234
|
-
1.
|
|
235
|
-
2.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
233
|
+
smol-toml
|
|
234
|
+
1.2x faster than fast-toml
|
|
235
|
+
2.92x faster than @iarna/toml
|
|
236
|
+
4.1x faster than @decimalturn/toml-patch
|
|
237
|
+
5.37x faster than deno's @std/toml
|
|
238
|
+
5.94x faster than js-toml
|
|
239
|
+
7.31x faster than @ltd/j-toml
|
|
240
|
+
7.76x faster than node-toml
|
|
241
241
|
|
|
242
242
|
โข 5MB document
|
|
243
243
|
------------------------------------------- -------------------------------
|
|
244
|
-
smol-toml
|
|
245
|
-
(
|
|
246
|
-
(
|
|
247
|
-
2.
|
|
248
|
-
|
|
244
|
+
smol-toml 113.76 ms/iter 115.67 ms โ โ โ
|
|
245
|
+
(106.25 ms โฆ 121.53 ms) 118.63 ms โ
โ โ
โ โ
โ โ
โ
|
|
246
|
+
( 37.31 mb โฆ 49.50 mb) 43.97 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
247
|
+
2.47 ipc ( 98.58% cache) 3.12M branch misses
|
|
248
|
+
606.38M cycles 1.50G instructions 78.32M c-refs 1.11M c-misses
|
|
249
249
|
|
|
250
250
|
@iarna/toml error: Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z at row 5, col 45, pos 569:
|
|
251
251
|
4: NfF6LuAerfn5mDPI7Cp 2qsrB4vGmJTyb5jNubOIBYYWrWlAsrw PX93S57gjb5GEhR8qOU5blDQmwfVJTA YvmJ9cE3cUZU NAJQgAbIdpZLhc4lOs4ZhMEWehhZqXCsVD1YP1vN2GEoM2WX''', 1986-05-27T18:36:13Z, -5460, "2ZAV3fYlb23hf7r7QoftVlicWE2iuwp", 4790.2253 ]
|
|
@@ -255,150 +255,148 @@ smol-toml 116.74 ms/iter 118.39 ms โ โ
|
|
|
255
255
|
|
|
256
256
|
|
|
257
257
|
|
|
258
|
-
@ltd/j-toml
|
|
259
|
-
(
|
|
260
|
-
(
|
|
261
|
-
2.
|
|
262
|
-
1.
|
|
258
|
+
@ltd/j-toml 189.89 ms/iter 197.10 ms โโ โ
|
|
259
|
+
(172.17 ms โฆ 237.08 ms) 210.60 ms โ
โ
โโ โ
โ
โ โ
|
|
260
|
+
( 19.71 mb โฆ 56.03 mb) 36.30 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
261
|
+
2.41 ipc ( 97.92% cache) 3.88M branch misses
|
|
262
|
+
1.03G cycles 2.49G instructions 143.96M c-refs 3.00M c-misses
|
|
263
263
|
|
|
264
|
-
fast-toml
|
|
265
|
-
(
|
|
266
|
-
( 13.
|
|
267
|
-
2.
|
|
268
|
-
|
|
264
|
+
fast-toml 92.24 ms/iter 95.41 ms โ โ
|
|
265
|
+
(88.83 ms โฆ 96.21 ms) 96.00 ms โ โ
โ
โ
โโ
โ
โ
โ
|
|
266
|
+
( 13.32 mb โฆ 34.90 mb) 24.06 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
267
|
+
2.90 ipc ( 98.44% cache) 2.44M branch misses
|
|
268
|
+
495.57M cycles 1.44G instructions 56.61M c-refs 881.60k c-misses
|
|
269
269
|
|
|
270
|
-
deno's @std/toml
|
|
271
|
-
(
|
|
272
|
-
(
|
|
273
|
-
3.
|
|
274
|
-
2.
|
|
270
|
+
deno's @std/toml 419.95 ms/iter 428.09 ms โ
|
|
271
|
+
(408.44 ms โฆ 434.51 ms) 431.58 ms โ โ
|
|
272
|
+
(182.20 mb โฆ 203.81 mb) 188.26 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
273
|
+
3.28 ipc ( 97.22% cache) 6.72M branch misses
|
|
274
|
+
2.27G cycles 7.46G instructions 215.21M c-refs 5.98M c-misses
|
|
275
275
|
|
|
276
|
-
node-toml
|
|
277
|
-
(
|
|
278
|
-
(
|
|
279
|
-
4.
|
|
280
|
-
2.
|
|
276
|
+
node-toml 549.86 ms/iter 559.64 ms โ โ
|
|
277
|
+
(527.73 ms โฆ 574.83 ms) 571.47 ms โ
โ
โ โ
โ
โ โ
โ
โ
|
|
278
|
+
( 21.62 mb โฆ 74.99 mb) 46.84 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
279
|
+
4.24 ipc ( 96.62% cache) 6.29M branch misses
|
|
280
|
+
2.95G cycles 12.49G instructions 236.46M c-refs 7.99M c-misses
|
|
281
281
|
|
|
282
|
-
js-toml
|
|
283
|
-
(
|
|
284
|
-
(
|
|
285
|
-
2.
|
|
286
|
-
1.
|
|
282
|
+
js-toml 336.03 ms/iter 328.58 ms โ
|
|
283
|
+
(310.28 ms โฆ 431.93 ms) 379.93 ms โ
โ โ
|
|
284
|
+
(267.75 mb โฆ 279.44 mb) 273.42 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
285
|
+
2.02 ipc ( 94.74% cache) 5.08M branch misses
|
|
286
|
+
1.65G cycles 3.33G instructions 113.18M c-refs 5.95M c-misses
|
|
287
287
|
|
|
288
|
-
@decimalturn/toml-patch
|
|
289
|
-
(
|
|
290
|
-
(
|
|
291
|
-
|
|
292
|
-
|
|
288
|
+
@decimalturn/toml-patch 186.32 ms/iter 185.91 ms โ โ
|
|
289
|
+
(178.55 ms โฆ 209.69 ms) 190.20 ms โ
โ
โ
โ โ
โโ
โ
โ
|
|
290
|
+
( 22.18 mb โฆ 62.13 mb) 26.09 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
291
|
+
2.90 ipc ( 97.50% cache) 3.72M branch misses
|
|
292
|
+
999.99M cycles 2.90G instructions 120.73M c-refs 3.01M c-misses
|
|
293
293
|
|
|
294
294
|
summary
|
|
295
295
|
fast-toml
|
|
296
|
-
1.
|
|
297
|
-
|
|
298
|
-
2.
|
|
299
|
-
3.
|
|
300
|
-
4.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
296
|
+
1.23x faster than smol-toml
|
|
297
|
+
2.02x faster than @decimalturn/toml-patch
|
|
298
|
+
2.06x faster than @ltd/j-toml
|
|
299
|
+
3.64x faster than js-toml
|
|
300
|
+
4.55x faster than deno's @std/toml
|
|
301
|
+
5.96x faster than node-toml
|
|
304
302
|
node --expose-gc bench/stringify.bench.ts
|
|
305
|
-
clk: ~5.
|
|
303
|
+
clk: ~5.52 GHz
|
|
306
304
|
cpu: AMD Ryzen 9 9950X3D 16-Core Processor
|
|
307
|
-
runtime: node 26.
|
|
305
|
+
runtime: node 26.5.0 (x64-linux)
|
|
308
306
|
|
|
309
307
|
benchmark avg (min โฆ max) p75 / p99 (min โฆ top 1%)
|
|
310
308
|
------------------------------------------- -------------------------------
|
|
311
309
|
โข spec document
|
|
312
310
|
------------------------------------------- -------------------------------
|
|
313
|
-
smol-toml 2.
|
|
314
|
-
(2.
|
|
315
|
-
( 4.
|
|
316
|
-
4.
|
|
317
|
-
12.
|
|
318
|
-
|
|
319
|
-
@iarna/toml 8.
|
|
320
|
-
(8.
|
|
321
|
-
(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
@ltd/j-toml 89.
|
|
326
|
-
(
|
|
327
|
-
( 4.
|
|
328
|
-
4.
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
deno's @std/toml 3.
|
|
332
|
-
(3.
|
|
333
|
-
(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
js-toml 3.
|
|
338
|
-
(3.
|
|
339
|
-
(
|
|
340
|
-
4.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
@decimalturn/toml-patch
|
|
344
|
-
(
|
|
345
|
-
(
|
|
346
|
-
4.
|
|
347
|
-
|
|
311
|
+
smol-toml 2.29 ยตs/iter 2.30 ยตs โ
โ
|
|
312
|
+
(2.26 ยตs โฆ 2.33 ยตs) 2.33 ยตs โโ โโโ โโโ โ
|
|
313
|
+
( 4.28 kb โฆ 4.65 kb) 4.54 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
314
|
+
4.45 ipc ( 99.40% cache) 5.23 branch misses
|
|
315
|
+
12.67k cycles 56.39k instructions 909.08 c-refs 5.43 c-misses
|
|
316
|
+
|
|
317
|
+
@iarna/toml 8.58 ยตs/iter 8.57 ยตs โ
|
|
318
|
+
(8.54 ยตs โฆ 8.79 ยตs) 8.63 ยตs โโโโ โ
|
|
319
|
+
(509.76 b โฆ 1.39 kb) 574.04 b โโโโโโโโโโโโโโโโโโโโโ
|
|
320
|
+
3.99 ipc ( 99.30% cache) 24.95 branch misses
|
|
321
|
+
48.05k cycles 191.70k instructions 6.20k c-refs 43.23 c-misses
|
|
322
|
+
|
|
323
|
+
@ltd/j-toml 89.59 ยตs/iter 89.41 ยตs โ
|
|
324
|
+
(70.85 ยตs โฆ 242.29 ยตs) 127.85 ยตs โ
|
|
325
|
+
( 4.02 kb โฆ 375.16 kb) 37.41 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
326
|
+
4.16 ipc ( 99.69% cache) 721.33 branch misses
|
|
327
|
+
495.22k cycles 2.06M instructions 28.23k c-refs 88.81 c-misses
|
|
328
|
+
|
|
329
|
+
deno's @std/toml 3.96 ยตs/iter 3.96 ยตs โ โ โ
|
|
330
|
+
(3.91 ยตs โฆ 4.43 ยตs) 4.01 ยตs โ
โโ โโ
โ โ
|
|
331
|
+
(803.91 b โฆ 3.95 kb) 965.01 b โ
โโโโ
โโโโ
โโ
โ
โ
โ
โโโโโ
โโ
|
|
332
|
+
3.85 ipc ( 99.45% cache) 11.59 branch misses
|
|
333
|
+
22.20k cycles 85.43k instructions 3.02k c-refs 16.58 c-misses
|
|
334
|
+
|
|
335
|
+
js-toml 3.69 ยตs/iter 3.71 ยตs โ โ
|
|
336
|
+
(3.65 ยตs โฆ 3.82 ยตs) 3.77 ยตs โ
โโ
โโ โโ
โ
|
|
337
|
+
( 6.46 kb โฆ 7.23 kb) 7.10 kb โโโโโโโ
โโโโโ
โโโโโโ
โโโ
|
|
338
|
+
4.14 ipc ( 98.79% cache) 11.99 branch misses
|
|
339
|
+
20.62k cycles 85.48k instructions 1.97k c-refs 23.80 c-misses
|
|
340
|
+
|
|
341
|
+
@decimalturn/toml-patch 48.60 ยตs/iter 48.28 ยตs โ
|
|
342
|
+
(45.59 ยตs โฆ 296.88 ยตs) 81.95 ยตs โ
|
|
343
|
+
(128.00 b โฆ 703.46 kb) 93.31 kb โโโโโโโโโโโโโโโโโโโโโ
|
|
344
|
+
4.05 ipc ( 99.26% cache) 533.40 branch misses
|
|
345
|
+
270.34k cycles 1.09M instructions 37.72k c-refs 278.17 c-misses
|
|
348
346
|
|
|
349
347
|
summary
|
|
350
348
|
smol-toml
|
|
351
|
-
1.
|
|
349
|
+
1.61x faster than js-toml
|
|
352
350
|
1.73x faster than deno's @std/toml
|
|
353
|
-
3.
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
3.75x faster than @iarna/toml
|
|
352
|
+
21.25x faster than @decimalturn/toml-patch
|
|
353
|
+
39.18x faster than @ltd/j-toml
|
|
356
354
|
|
|
357
355
|
โข 5MB document
|
|
358
356
|
------------------------------------------- -------------------------------
|
|
359
|
-
smol-toml
|
|
360
|
-
(
|
|
361
|
-
( 9.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
@iarna/toml
|
|
366
|
-
(
|
|
367
|
-
(
|
|
368
|
-
2.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
@ltd/j-toml
|
|
372
|
-
(
|
|
373
|
-
(
|
|
374
|
-
4.
|
|
375
|
-
5.
|
|
376
|
-
|
|
377
|
-
deno's @std/toml 68.
|
|
378
|
-
(
|
|
379
|
-
( 29.
|
|
380
|
-
2.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
js-toml
|
|
384
|
-
(
|
|
385
|
-
(
|
|
386
|
-
2.
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
@decimalturn/toml-patch
|
|
390
|
-
|
|
391
|
-
(
|
|
392
|
-
3.
|
|
393
|
-
5.
|
|
357
|
+
smol-toml 45.33 ms/iter 46.14 ms โ โ
|
|
358
|
+
(42.89 ms โฆ 48.08 ms) 47.97 ms โ
โ
โ
โ
โโ
โ โ
โ
|
|
359
|
+
( 9.41 mb โฆ 35.68 mb) 12.98 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
360
|
+
1.98 ipc ( 94.06% cache) 1.62M branch misses
|
|
361
|
+
234.88M cycles 464.38M instructions 12.57M c-refs 746.25k c-misses
|
|
362
|
+
|
|
363
|
+
@iarna/toml 130.01 ms/iter 130.79 ms โ โ
|
|
364
|
+
(127.84 ms โฆ 135.01 ms) 132.06 ms โ โ
โ โ
โ
โ
โ
โ
โ
|
|
365
|
+
( 23.69 mb โฆ 51.95 mb) 41.55 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
366
|
+
2.54 ipc ( 96.96% cache) 4.31M branch misses
|
|
367
|
+
707.33M cycles 1.80G instructions 73.12M c-refs 2.22M c-misses
|
|
368
|
+
|
|
369
|
+
@ltd/j-toml 928.19 ms/iter 933.90 ms โ
|
|
370
|
+
(903.30 ms โฆ 940.61 ms) 934.55 ms โ โ
|
|
371
|
+
( 1.89 mb โฆ 32.62 mb) 12.57 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
372
|
+
4.02 ipc ( 99.15% cache) 7.29M branch misses
|
|
373
|
+
5.09G cycles 20.45G instructions 194.29M c-refs 1.66M c-misses
|
|
374
|
+
|
|
375
|
+
deno's @std/toml 68.58 ms/iter 70.20 ms โ
|
|
376
|
+
(63.51 ms โฆ 78.12 ms) 75.83 ms โ
โ
|
|
377
|
+
( 29.19 mb โฆ 62.19 mb) 33.69 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
378
|
+
2.14 ipc ( 94.82% cache) 1.78M branch misses
|
|
379
|
+
341.59M cycles 731.18M instructions 26.60M c-refs 1.38M c-misses
|
|
380
|
+
|
|
381
|
+
js-toml 110.26 ms/iter 111.58 ms โ
|
|
382
|
+
(106.23 ms โฆ 118.30 ms) 116.43 ms โ
|
|
383
|
+
( 31.58 mb โฆ 62.06 mb) 43.79 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
384
|
+
2.29 ipc ( 96.17% cache) 3.09M branch misses
|
|
385
|
+
596.81M cycles 1.36G instructions 41.90M c-refs 1.60M c-misses
|
|
386
|
+
|
|
387
|
+
@decimalturn/toml-patch 933.72 ms/iter 950.61 ms โ โ โ
|
|
388
|
+
(898.60 ms โฆ 969.27 ms) 955.92 ms โ โ
โ
โ
โ
โ โ
โ
|
|
389
|
+
(119.41 mb โฆ 147.95 mb) 122.51 mb โโโโโโโโโโโโโโโโโโโโโ
|
|
390
|
+
3.20 ipc ( 93.32% cache) 12.50M branch misses
|
|
391
|
+
5.05G cycles 16.18G instructions 694.63M c-refs 46.41M c-misses
|
|
394
392
|
|
|
395
393
|
summary
|
|
396
394
|
smol-toml
|
|
397
|
-
1.
|
|
398
|
-
2.
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
395
|
+
1.51x faster than deno's @std/toml
|
|
396
|
+
2.43x faster than js-toml
|
|
397
|
+
2.87x faster than @iarna/toml
|
|
398
|
+
20.48x faster than @ltd/j-toml
|
|
399
|
+
20.6x faster than @decimalturn/toml-patch
|
|
402
400
|
```
|
|
403
401
|
|
|
404
402
|
</details>
|
package/dist/date.d.ts
CHANGED
package/dist/date.js
CHANGED
package/dist/error.d.ts
CHANGED
|
@@ -33,7 +33,6 @@ export declare class TomlError extends Error {
|
|
|
33
33
|
line: number;
|
|
34
34
|
column: number;
|
|
35
35
|
codeblock: string;
|
|
36
|
-
constructor(message: string, options: TomlErrorOptions);
|
|
36
|
+
constructor(message: string, /** @internal */ options: TomlErrorOptions);
|
|
37
37
|
}
|
|
38
38
|
export {};
|
|
39
|
-
//# sourceMappingURL=error.d.ts.map
|
package/dist/error.js
CHANGED
|
@@ -49,16 +49,17 @@ function makeCodeBlock(string, line, column) {
|
|
|
49
49
|
return codeblock;
|
|
50
50
|
}
|
|
51
51
|
export class TomlError extends Error {
|
|
52
|
+
options;
|
|
52
53
|
line;
|
|
53
54
|
column;
|
|
54
55
|
codeblock;
|
|
55
|
-
constructor(message, options) {
|
|
56
|
+
constructor(message, /** @internal */ options) {
|
|
56
57
|
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
57
58
|
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
58
59
|
super(`Invalid TOML document: ${message}\n\n${codeblock}`, options);
|
|
60
|
+
this.options = options;
|
|
59
61
|
this.line = line;
|
|
60
62
|
this.column = column;
|
|
61
63
|
this.codeblock = codeblock;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
//# sourceMappingURL=error.js.map
|