@zakkster/lite-perf-gate 1.2.0 → 1.2.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,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.2] - 2026-09-13
4
+
5
+ - **Version truth**: `VERSION` reads `1.2.2` and agrees with
6
+ `package.json` and this file. The published 1.2.1 tarball shipped
7
+ `VERSION = '1.2.0'`; see the 1.2.1 entry below.
8
+ - **`prepublishOnly: npm test`** -- the publish path now runs the suite.
9
+ The guard test caught the 1.2.1 slip locally; nothing forced it to run
10
+ before `npm publish`. That gap, not the string, was the defect.
11
+ - **Self-test**: the VERSION test no longer pins a literal; it asserts
12
+ only `VERSION === package.json.version`. The literal forced a test edit
13
+ every release, which is the friction that got skipped.
14
+ - Housekeeping: `var -> let/const` in `PerfGate.js`, trailing newline at
15
+ EOF restored, demo `<title>` version.
16
+ - No API change and no behavior change to any exported function.
17
+
18
+ ## [1.2.1] - 2026-07-08
19
+
20
+ Retroactive entry, written 2026-09-13: 1.2.1 was published with no
21
+ changelog entry.
22
+
23
+ - Housekeeping only: `var -> let/const` cleanup in `PerfGate.js` and the
24
+ `package.json` bump. Verified by unpacking the published tarball: no
25
+ API change and no behavior change relative to 1.2.0.
26
+ - **Known defect, fixed in 1.2.2**: the tarball shipped
27
+ `export const VERSION = '1.2.0';` and a CHANGELOG ending at 1.2.0. The
28
+ self-test that asserts VERSION against the manifest would have caught
29
+ it; there was no `prepublishOnly` to make it run.
30
+
3
31
  ## [1.2.0] - 2026-07-07
4
32
 
5
33
  - **`toNDJSON(x, meta?)`** -- NDJSON verdict output for CI artifacts.
@@ -10,6 +38,10 @@
10
38
 
11
39
  ## [1.1.0] - 2026-07-07
12
40
 
41
+ > Never published standalone. The registry has 1.0.0, 1.0.1, 1.2.0,
42
+ > 1.2.1 -- no 1.1.0. The features below first reached the registry
43
+ > inside 1.2.0.
44
+
13
45
  - **`suiteGate(config)`** -- SPP stream-fed budgets. Consumes a Float64Array
14
46
  slab or any forEach record source (a lite-scope memory sink qualifies),
15
47
  reduces per-budget metrics (count/sum/max/mean/last over slot t/a/b,
package/PerfGate.js CHANGED
@@ -17,7 +17,7 @@
17
17
  * MIT License
18
18
  */
19
19
 
20
- export const VERSION = '1.2.0';
20
+ export const VERSION = '1.2.2';
21
21
 
22
22
  import {PerformanceObserver, constants} from 'node:perf_hooks';
23
23
  import {setTimeout as sleep} from 'node:timers/promises';
@@ -57,7 +57,9 @@ async function gc2() {
57
57
  // teardown (used across the ecosystem in lite-cleanup / lite-observe
58
58
  // / lite-floating) can leave the heap in an intermediate state
59
59
  // between the two collections, inflating the retained delta.
60
- await new Promise(function (r) { setImmediate(r); });
60
+ await new Promise(function (r) {
61
+ setImmediate(r);
62
+ });
61
63
  globalThis.gc();
62
64
  }
63
65
  }
@@ -69,9 +71,9 @@ async function gc2() {
69
71
  // contention) can stall the event loop for tens of milliseconds and drop
70
72
  // entries with a shorter wait. Override per-measurement via the `flushMs`
71
73
  // option, or globally via the PERF_GATE_FLUSH_MS environment variable.
72
- var DEFAULT_FLUSH_MS = 100;
74
+ let DEFAULT_FLUSH_MS = 100;
73
75
  if (typeof process !== 'undefined' && process.env && process.env.PERF_GATE_FLUSH_MS) {
74
- var envMs = parseInt(process.env.PERF_GATE_FLUSH_MS, 10);
76
+ const envMs = parseInt(process.env.PERF_GATE_FLUSH_MS, 10);
75
77
  if (envMs > 0 && envMs < 60000) DEFAULT_FLUSH_MS = envMs;
76
78
  }
77
79
 
@@ -446,10 +448,10 @@ export async function runGate(config) {
446
448
  // runGate) stay in the runner layer. All threshold comparison is delegated
447
449
  // to verdict() -- one comparison authority, per-budget.
448
450
 
449
- var SPP_OP_CONT = 0x0F01;
451
+ const SPP_OP_CONT = 0x0F01;
450
452
 
451
- var SUITE_REDUCES = {count: 1, sum: 1, max: 1, mean: 1, last: 1};
452
- var SUITE_SLOTS = {t: 1, a: 2, b: 3};
453
+ const SUITE_REDUCES = {count: 1, sum: 1, max: 1, mean: 1, last: 1};
454
+ const SUITE_SLOTS = {t: 1, a: 2, b: 3};
453
455
 
454
456
  function suiteMatcher(b, i) {
455
457
  if (b.packed !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-perf-gate",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
5
5
  "description": "Zero-GC and performance regression gate for node:test. Scavenge-counting, scaling verdict, detector self-validation. Proves your hot path allocates nothing -- or names what did.",
6
6
  "type": "module",
@@ -25,7 +25,8 @@
25
25
  "CHANGELOG.md"
26
26
  ],
27
27
  "scripts": {
28
- "test": "node --expose-gc --max-semi-space-size=4 --test test/self.test.mjs"
28
+ "test": "node --expose-gc --max-semi-space-size=4 --test test/self.test.mjs",
29
+ "prepublishOnly": "npm test"
29
30
  },
30
31
  "keywords": [
31
32
  "benchmark",