@thi.ng/bench 3.0.7 → 3.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,103 +1,147 @@
1
1
  # Change Log
2
2
 
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
+
3
6
  All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
5
8
 
6
- ## [3.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@3.0.6...@thi.ng/bench@3.0.7) (2021-11-03)
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
7
11
 
8
- **Note:** Version bump only for package @thi.ng/bench
12
+ ## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@3.1.0) (2021-11-17)
9
13
 
14
+ #### 🚀 Features
10
15
 
16
+ - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
17
+ Improving the overall build ergonomics
18
+ - introduced a tools workspaces
19
+ - imported it in all needed packages/examples
20
+ - inclusive project root
11
21
 
22
+ #### ♻️ Refactoring
12
23
 
24
+ - testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
25
+ this commit reverts (partly) changes made in:
26
+ ef346d7a8753590dc9094108a3d861a8dbd5dd2c
27
+ overall purpose is better testament ergonomics:
28
+ instead of having to pass NODE_OPTIONS with every invocation
29
+ having a binary to handle this for us.
13
30
 
14
- # [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.1.6...@thi.ng/bench@3.0.0) (2021-10-12)
31
+ ### [3.0.8](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@3.0.8) (2021-11-10)
15
32
 
33
+ #### ♻️ Refactoring
16
34
 
17
- ### Build System
35
+ - update all countdown loops ([a5f374b](https://github.com/thi-ng/umbrella/commit/a5f374b))
18
36
 
19
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
37
+ ### [3.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@3.0.1) (2021-10-13)
20
38
 
39
+ #### ♻️ Refactoring
21
40
 
22
- ### Features
41
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
42
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
43
+ - add .js suffix for all relative imports
23
44
 
24
- * **bench:** add timeDiff, Timestamp type ([c612de0](https://github.com/thi-ng/umbrella/commit/c612de0574d59d9e0951443ae98b8bd14c3a0a09))
45
+ # [3.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@3.0.0) (2021-10-12)
25
46
 
47
+ #### 🛑 Breaking changes
26
48
 
27
- ### BREAKING CHANGES
49
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
50
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
51
+ - only ESM modules will be published from now on
52
+ - CJS obsolete due to ESM support in recent versions of node:
53
+ - i.e. launch NodeJS via:
54
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
55
+ - in the node REPL use `await import(...)` instead of `require()`
56
+ - UMD obsolete due to widespread browser support for ESM
57
+ Also:
58
+ - normalize/restructure/reorg all package.json files
59
+ - cleanup all build scripts, remove obsolete
60
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
28
61
 
29
- * discontinue CommonJS & UMD versions
62
+ #### 🚀 Features
30
63
 
31
- - only ESM modules will be published from now on
32
- - CJS obsolete due to ESM support in recent versions of node:
33
- - i.e. launch NodeJS via:
34
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
35
- - in the node REPL use `await import(...)` instead of `require()`
36
- - UMD obsolete due to widespread browser support for ESM
64
+ - add timeDiff, Timestamp type ([c612de0](https://github.com/thi-ng/umbrella/commit/c612de0))
37
65
 
38
- Also:
39
- - normalize/restructure/reorg all package.json files
40
- - cleanup all build scripts, remove obsolete
41
- - switch from mocha to @thi.ng/testament for all tests
66
+ #### ♻️ Refactoring
42
67
 
68
+ - update all test stubs ([f2d6d53](https://github.com/thi-ng/umbrella/commit/f2d6d53))
69
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
70
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
43
71
 
72
+ ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@2.1.0) (2021-03-12)
44
73
 
74
+ #### 🚀 Features
45
75
 
76
+ - add suite & formatters, update benchmark() ([5ea02bd](https://github.com/thi-ng/umbrella/commit/5ea02bd))
77
+ - add `suite()` benchmark runner
78
+ - update `BenchmarkOpts` & `benchmark()`
79
+ - add `size` option to configure calls per iteration
80
+ - add `format` option to configure formatter
81
+ - add `BenchmarkFormatter` interface
82
+ - add `FORMAT_DEFAULT`, `FORMAT_CSV` & `FORMAT_MD` formatters
46
83
 
84
+ ### [2.0.24](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@2.0.24) (2020-12-07)
47
85
 
48
- # [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.31...@thi.ng/bench@2.1.0) (2021-03-12)
86
+ #### ♻️ Refactoring
49
87
 
50
- ### Features
88
+ - update type-only imports ([e6c8d98](https://github.com/thi-ng/umbrella/commit/e6c8d98))
51
89
 
52
- - **bench:** add suite & formatters, update benchmark() ([5ea02bd](https://github.com/thi-ng/umbrella/commit/5ea02bd0cfe71ff388d24906b7ce2a7ce4e72ce8))
90
+ ### [2.0.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@2.0.6) (2020-04-03)
53
91
 
54
- ## [2.0.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.5...@thi.ng/bench@2.0.6) (2020-04-03)
92
+ #### 🩹 Bug fixes
55
93
 
56
- ### Bug Fixes
94
+ - update timedResult() to always downscale to ms ([fb2c632](https://github.com/thi-ng/umbrella/commit/fb2c632))
95
+ - fallback handlingin now() ([6494851](https://github.com/thi-ng/umbrella/commit/6494851))
57
96
 
58
- - **bench:** fallback handlingin now() ([6494851](https://github.com/thi-ng/umbrella/commit/64948518a6412cabf53664ac9f89bac2b7ef6892))
59
- - **bench:** update timedResult() to always downscale to ms ([fb2c632](https://github.com/thi-ng/umbrella/commit/fb2c6327358ccaf93314d2cdbfd3f8ff04becbd1))
97
+ ### [2.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@2.0.1) (2020-02-25)
60
98
 
61
- # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@1.0.11...@thi.ng/bench@2.0.0) (2020-01-24)
99
+ #### ♻️ Refactoring
62
100
 
63
- ### Bug Fixes
101
+ - update imports ([cfdcd3a](https://github.com/thi-ng/umbrella/commit/cfdcd3a))
64
102
 
65
- - **bench:** update now() to only OPTIONALLY use bigint timestamps ([7ac391b](https://github.com/thi-ng/umbrella/commit/7ac391b58b7e8b3b6fdc458d1edda6ca441d379b))
103
+ # [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@2.0.0) (2020-01-24)
66
104
 
67
- ### Features
105
+ #### 🛑 Breaking changes
68
106
 
69
- - **bench:** add types, benchmark(), bigint timestamps, restructure ([e0af94c](https://github.com/thi-ng/umbrella/commit/e0af94cfbedea46a4131ec8243f2553e49a5e644))
107
+ - add types, benchmark(), bigint timestamps, restructure ([e0af94c](https://github.com/thi-ng/umbrella/commit/e0af94c))
108
+ - split module into separate files
109
+ - add BenchmarkOpts / BenchmarkResult types
110
+ - add benchmark()
111
+ - add now() timestamp fn (uses nanosec timer on Node)
112
+ - BREAKING CHANGE: Though no public API change, this library internally
113
+ uses ES BigInt timestamps now (in Node via `process.hrtime.bigint()`).
70
114
 
71
- ### BREAKING CHANGES
115
+ #### 🩹 Bug fixes
72
116
 
73
- - **bench:** Though no public API change, this library internally uses ES BigInt timestamps now (in Node via `process.hrtime.bigint()`).
117
+ - update now() to only OPTIONALLY use bigint timestamps ([7ac391b](https://github.com/thi-ng/umbrella/commit/7ac391b))
74
118
 
75
- # [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@0.3.1...@thi.ng/bench@1.0.0) (2019-01-21)
119
+ # [1.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@1.0.0) (2019-01-21)
76
120
 
77
- ### Build System
121
+ #### 🛑 Breaking changes
78
122
 
79
123
  - update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
124
+ - BREAKING CHANGE: enabled multi-outputs (ES6 modules, CJS, UMD)
125
+ - build scripts now first build ES6 modules in package root, then call
126
+ `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
127
+ - all imports MUST be updated to only refer to package level
128
+ (not individual files anymore). tree shaking in user land will get rid of
129
+ all unused imported symbols.
80
130
 
81
- ### BREAKING CHANGES
82
-
83
- - enabled multi-outputs (ES6 modules, CJS, UMD)
84
- - build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
85
- - all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
86
-
87
- # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@0.2.4...@thi.ng/bench@0.3.0) (2018-10-21)
131
+ ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@0.3.0) (2018-10-21)
88
132
 
89
- ### Features
133
+ #### 🚀 Features
90
134
 
91
- - **bench:** add timedResult() / benchResult() ([0cf708f](https://github.com/thi-ng/umbrella/commit/0cf708f))
135
+ - add timedResult() / benchResult() ([0cf708f](https://github.com/thi-ng/umbrella/commit/0cf708f))
92
136
 
93
- # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@0.1.5...@thi.ng/bench@0.2.0) (2018-08-28)
137
+ ## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@0.2.0) (2018-08-28)
94
138
 
95
- ### Features
139
+ #### 🚀 Features
96
140
 
97
- - **bench:** add opt prefix arg, update docs ([4a37367](https://github.com/thi-ng/umbrella/commit/4a37367))
141
+ - add opt prefix arg, update docs ([4a37367](https://github.com/thi-ng/umbrella/commit/4a37367))
98
142
 
99
- # 0.1.0 (2018-05-10)
143
+ ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@0.1.0) (2018-05-10)
100
144
 
101
- ### Features
145
+ #### 🚀 Features
102
146
 
103
- - **bench:** add new package [@thi](https://github.com/thi).ng/bench ([9466d4b](https://github.com/thi-ng/umbrella/commit/9466d4b))
147
+ - add new package [@thi.ng/bench](https://github.com/thi-ng/umbrella/tree/main/packages/bench) ([9466d4b](https://github.com/thi-ng/umbrella/commit/9466d4b))
package/README.md CHANGED
@@ -68,7 +68,7 @@ node --experimental-repl-await
68
68
  > const bench = await import("@thi.ng/bench");
69
69
  ```
70
70
 
71
- Package sizes (gzipped, pre-treeshake): ESM: 1.39 KB
71
+ Package sizes (gzipped, pre-treeshake): ESM: 1.36 KB
72
72
 
73
73
  ## Dependencies
74
74
 
package/benchmark.js CHANGED
@@ -15,7 +15,7 @@ export const benchmark = (fn, opts) => {
15
15
  const t = benchResult(fn, warmup * size)[1];
16
16
  output && outputString(format.warmup(t, _opts));
17
17
  const samples = [];
18
- for (let i = iter; --i >= 0;) {
18
+ for (let i = iter; i-- > 0;) {
19
19
  samples.push(benchResult(fn, size)[1]);
20
20
  }
21
21
  samples.sort((a, b) => a - b);
package/package.json CHANGED
@@ -1,112 +1,118 @@
1
1
  {
2
- "name": "@thi.ng/bench",
3
- "version": "3.0.7",
4
- "description": "Benchmarking utilities w/ various statistics & formatters (CSV, Markdown etc.)",
5
- "type": "module",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
8
- "sideEffects": false,
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
2
+ "name": "@thi.ng/bench",
3
+ "version": "3.1.2",
4
+ "description": "Benchmarking utilities w/ various statistics & formatters (CSV, Markdown etc.)",
5
+ "type": "module",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/thi-ng/umbrella.git"
12
+ },
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/bench#readme",
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/postspectacular"
12
18
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/bench#readme",
14
- "funding": [
15
- {
16
- "type": "github",
17
- "url": "https://github.com/sponsors/postspectacular"
18
- },
19
- {
20
- "type": "patreon",
21
- "url": "https://patreon.com/thing_umbrella"
22
- }
23
- ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
25
- "license": "Apache-2.0",
26
- "scripts": {
27
- "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf *.js *.d.ts *.map doc",
29
- "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
- "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
- "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
- "pub": "yarn build && yarn publish --access public",
34
- "test": "testament test"
19
+ {
20
+ "type": "patreon",
21
+ "url": "https://patreon.com/thing_umbrella"
22
+ }
23
+ ],
24
+ "author": "Karsten Schmidt <k+npm@thi.ng>",
25
+ "license": "Apache-2.0",
26
+ "scripts": {
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
+ "doc:readme": "yarn doc:stats && tools:readme",
32
+ "doc:stats": "tools:module-stats",
33
+ "pub": "yarn npm publish --access public",
34
+ "test": "testament test"
35
+ },
36
+ "dependencies": {
37
+ "@thi.ng/api": "^8.3.2"
38
+ },
39
+ "devDependencies": {
40
+ "@microsoft/api-extractor": "^7.18.19",
41
+ "@thi.ng/testament": "^0.2.2",
42
+ "@types/node": "^16.11.7",
43
+ "rimraf": "^3.0.2",
44
+ "tools": "^0.0.1",
45
+ "typedoc": "^0.22.9",
46
+ "typescript": "^4.5.2"
47
+ },
48
+ "keywords": [
49
+ "benchmark",
50
+ "bigint",
51
+ "csv",
52
+ "execution",
53
+ "format",
54
+ "functional",
55
+ "hrtime",
56
+ "markdown",
57
+ "measure",
58
+ "statistics",
59
+ "table",
60
+ "time",
61
+ "typescript"
62
+ ],
63
+ "publishConfig": {
64
+ "access": "public"
65
+ },
66
+ "browser": {
67
+ "process": false,
68
+ "setTimeout": false
69
+ },
70
+ "engines": {
71
+ "node": ">=12.7"
72
+ },
73
+ "files": [
74
+ "*.js",
75
+ "*.d.ts",
76
+ "format"
77
+ ],
78
+ "exports": {
79
+ ".": {
80
+ "import": "./index.js"
35
81
  },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0"
82
+ "./api": {
83
+ "import": "./api.js"
38
84
  },
39
- "devDependencies": {
40
- "@thi.ng/testament": "^0.1.6"
85
+ "./bench": {
86
+ "import": "./bench.js"
41
87
  },
42
- "keywords": [
43
- "benchmark",
44
- "bigint",
45
- "csv",
46
- "execution",
47
- "format",
48
- "functional",
49
- "hrtime",
50
- "markdown",
51
- "measure",
52
- "statistics",
53
- "table",
54
- "time",
55
- "typescript"
56
- ],
57
- "publishConfig": {
58
- "access": "public"
88
+ "./benchmark": {
89
+ "import": "./benchmark.js"
59
90
  },
60
- "browser": {
61
- "process": false,
62
- "setTimeout": false
91
+ "./format/csv": {
92
+ "import": "./format/csv.js"
63
93
  },
64
- "engines": {
65
- "node": ">=12.7"
94
+ "./format/default": {
95
+ "import": "./format/default.js"
66
96
  },
67
- "files": [
68
- "*.js",
69
- "*.d.ts",
70
- "format"
71
- ],
72
- "exports": {
73
- ".": {
74
- "import": "./index.js"
75
- },
76
- "./api": {
77
- "import": "./api.js"
78
- },
79
- "./bench": {
80
- "import": "./bench.js"
81
- },
82
- "./benchmark": {
83
- "import": "./benchmark.js"
84
- },
85
- "./format/csv": {
86
- "import": "./format/csv.js"
87
- },
88
- "./format/default": {
89
- "import": "./format/default.js"
90
- },
91
- "./format/markdown": {
92
- "import": "./format/markdown.js"
93
- },
94
- "./now": {
95
- "import": "./now.js"
96
- },
97
- "./suite": {
98
- "import": "./suite.js"
99
- },
100
- "./timed": {
101
- "import": "./timed.js"
102
- }
97
+ "./format/markdown": {
98
+ "import": "./format/markdown.js"
103
99
  },
104
- "thi.ng": {
105
- "related": [
106
- "csv",
107
- "hiccup-markdown"
108
- ],
109
- "year": 2018
100
+ "./now": {
101
+ "import": "./now.js"
110
102
  },
111
- "gitHead": "852cd2450617c86d15d18477dc634f17f04202eb"
112
- }
103
+ "./suite": {
104
+ "import": "./suite.js"
105
+ },
106
+ "./timed": {
107
+ "import": "./timed.js"
108
+ }
109
+ },
110
+ "thi.ng": {
111
+ "related": [
112
+ "csv",
113
+ "hiccup-markdown"
114
+ ],
115
+ "year": 2018
116
+ },
117
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
118
+ }