@thi.ng/bench 3.4.29 → 3.4.31
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 +1 -1
- package/README.md +13 -14
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> ‼️ Announcing the thi.ng user survey 2024 📋
|
|
5
|
-
>
|
|
6
|
-
> [Please participate in the survey here!](https://forms.gle/XacbSDEmQMPZg8197)\
|
|
7
|
-
> (open until end of February)
|
|
8
|
-
>
|
|
9
|
-
> **To achieve a better sample size, I'd highly appreciate if you could
|
|
10
|
-
> circulate the link to this survey in your own networks.**
|
|
11
|
-
>
|
|
12
|
-
> [Discussion](https://github.com/thi-ng/umbrella/discussions/447)
|
|
13
|
-
|
|
14
3
|
# 
|
|
15
4
|
|
|
16
5
|
[](https://www.npmjs.com/package/@thi.ng/bench)
|
|
@@ -22,7 +11,7 @@
|
|
|
22
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
23
12
|
> and anti-framework.
|
|
24
13
|
>
|
|
25
|
-
> 🚀
|
|
14
|
+
> 🚀 Please help me to work full-time on these projects by [sponsoring me on
|
|
26
15
|
> GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
|
|
27
16
|
|
|
28
17
|
- [About](#about)
|
|
@@ -165,6 +154,10 @@ Also see the [formatting](#output-formatting) section below for other output
|
|
|
165
154
|
options. This example uses the default format...
|
|
166
155
|
|
|
167
156
|
```ts
|
|
157
|
+
import { benchmark } from "@thi.ng/bench";
|
|
158
|
+
|
|
159
|
+
// fib() function is from previous example above...
|
|
160
|
+
|
|
168
161
|
benchmark(() => fib(40), { title: "fib", iter: 10, warmup: 5 });
|
|
169
162
|
// benchmarking: fib
|
|
170
163
|
// warmup... 3707.17ms (5 runs)
|
|
@@ -195,14 +188,18 @@ Multiple benchmarks can be run sequentially as suite (also returns an array of
|
|
|
195
188
|
all results):
|
|
196
189
|
|
|
197
190
|
```ts
|
|
198
|
-
|
|
191
|
+
import { suite, FORMAT_MD } from "@thi.ng/bench";
|
|
192
|
+
|
|
193
|
+
// fib2() function defined in earlier example above...
|
|
194
|
+
|
|
195
|
+
suite(
|
|
199
196
|
[
|
|
200
197
|
{ title: "fib2(10)", fn: () => fib2(10) },
|
|
201
198
|
{ title: "fib2(20)", fn: () => fib2(20) },
|
|
202
199
|
{ title: "fib2(30)", fn: () => fib2(30) },
|
|
203
200
|
{ title: "fib2(40)", fn: () => fib2(40) },
|
|
204
201
|
],
|
|
205
|
-
{ iter: 10, size: 100000, warmup: 5, format:
|
|
202
|
+
{ iter: 10, size: 100000, warmup: 5, format: FORMAT_MD }
|
|
206
203
|
)
|
|
207
204
|
|
|
208
205
|
// | Title| Iter| Size| Total| Mean| Median| Min| Max| Q1| Q3| SD%|
|
|
@@ -240,6 +237,8 @@ enabled/disabled, supports recursion and estimates/subtracts its internal
|
|
|
240
237
|
overhead. Results can be obtained as JSON objects or CSV.
|
|
241
238
|
|
|
242
239
|
```ts
|
|
240
|
+
import { Profiler } from "@thi.ng/bench";
|
|
241
|
+
|
|
243
242
|
// initialize with 1million warmup iterations to compute internal overhead (takes around ~100ms)
|
|
244
243
|
const profiler = new Profiler({ warmup: 1e6 });
|
|
245
244
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/bench",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.31",
|
|
4
4
|
"description": "Benchmarking & profiling utilities w/ various statistics & formatters (CSV, JSON, Markdown etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
38
|
+
"@thi.ng/api": "^8.9.27"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@microsoft/api-extractor": "^7.40.1",
|
|
42
|
-
"@thi.ng/testament": "^0.4.
|
|
42
|
+
"@thi.ng/testament": "^0.4.21",
|
|
43
43
|
"@types/node": "^20.11.17",
|
|
44
44
|
"esbuild": "^0.20.0",
|
|
45
45
|
"rimraf": "^5.0.5",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
],
|
|
120
120
|
"year": 2018
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "df9e312af741d87e6b450afcfea6a6e381662b1e\n"
|
|
123
123
|
}
|