@zakkster/lite-perf-gate 1.2.0 → 1.2.1

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.
Files changed (2) hide show
  1. package/PerfGate.js +9 -7
  2. package/package.json +1 -1
package/PerfGate.js CHANGED
@@ -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) {
@@ -654,4 +656,4 @@ export function toNDJSON(x, meta) {
654
656
  }
655
657
  }
656
658
  return lines.join('\n') + '\n';
657
- }
659
+ }
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.1",
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",