@cosyte/bench 0.1.3 → 0.1.4

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 (3) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +20 -5
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - c854d59: `@cosyte/script-utils`: the attw gate (`cosyte-attw`, `runAttwGate` and `runAttwCli`) now starts on
8
+ Windows. It used to check `node_modules/.bin/attw` and start it without a shell; on Windows that file
9
+ is a POSIX shell script, so the start failed with ENOENT, and npm and pnpm, which the gate also
10
+ starts, are `.cmd` files there that Node will not start without a shell. On Windows the gate now
11
+ checks and starts `node_modules/.bin/attw.cmd`, and starts all three tools through `cmd.exe` with
12
+ every argument and every path on the command line in double quotes, a trailing run of backslashes
13
+ doubled so each argument arrives whole. Elsewhere nothing changes. Two new exports,
14
+ `attwBinaryPath(callerUrl, platform?)` and `toolCommand(file, args, platform?)`, say which binary and
15
+ which command line. The gate now refuses an argument carrying a double quote, a percent sign or a
16
+ line break, on every system: no argument it accepts needs one. A repository that skipped the attw
17
+ step on Windows can drop the skip once it takes this version. Callers change nothing.
18
+
19
+ `@cosyte/bench`: the README now says what the small-input memory budget gives up: a cost in fewer
20
+ than half of a small case's 20 calls is not bounded, the rule switches at a hard 64 KiB edge, and
21
+ the empty-call floor's highest call is not a fixed figure (usually about 29 KiB, once 369,888
22
+ bytes) while its median is stable at about 3.4 KiB. No behavior changes.
23
+
3
24
  ## 0.1.3
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -165,17 +165,32 @@ through the same probe (`memoryFloor`), and gives each peak figure both raw and
165
165
  median, never below zero (`peakTotalAboveFloorBytes`, `medianPeakTotalAboveFloorBytes`, and the same
166
166
  for the heap and external memory).
167
167
 
168
- On a GitHub-hosted runner the floor's median call is about 3.3 KiB and its highest about 28 KiB (one
169
- call, the first). That highest call is the probe's, and it lands in a case's highest peak too, which
170
- is why a few hundred bytes of input could not read under 20 times its size whatever the code did.
168
+ On a GitHub-hosted runner the floor's median call is stable, about 3.4 KiB. Its highest call is not:
169
+ usually about 29 KiB (one call, the first), and once 369,888 bytes. That highest call is the
170
+ probe's, and it lands in a case's highest peak too, which is why a few hundred bytes of input could
171
+ not read under 20 times its size whatever the code did. Read the floor's median as the probe's cost;
172
+ its highest is not a fixed figure.
171
173
 
172
174
  A memory budget reads `budgetPeakBytes(caseReading)`: for a case whose inputs average under
173
175
  `BENCH_CONTRACT.FLOOR_INPUT_BYTES` (64 KiB) it is the median call's total above the floor's median,
174
176
  the code's typical call without the probe; for any other case, or one whose suite gave no byte
175
- count, it is the highest raw `peakTotalBytes`. At 64 KiB even the probe's highest call is about 2%
176
- of a 20 times budget, so a large input keeps the raw highest figure, which needs nothing from
177
+ count, it is the highest raw `peakTotalBytes`. At 64 KiB the probe's usual highest call is about
178
+ 2% of a 20 times budget, so a large input keeps the raw highest figure, which needs nothing from
177
179
  another process. A suite that added its own empty "floor" case can drop it.
178
180
 
181
+ What the rule gives up:
182
+
183
+ - **A cost in fewer than half the calls is not bounded.** Under 64 KiB the budget reads the median
184
+ of the case's 20 calls, so a cost that shows in fewer than half of them does not move it. In one
185
+ reading a small case's highest call was 292,784 bytes against a median of 38,672: the budget read
186
+ the median. The highest raw peak is still in the reading (`peakTotalBytes`) for anyone who looks.
187
+ - **The switch is a hard edge at 64 KiB.** A case whose inputs average 64 KiB or more reads its
188
+ highest raw total, and one a byte under reads its median call above the floor. Two sizes either
189
+ side of the edge can therefore read very different budgets for the same code.
190
+ - **The 2% is the usual highest, not every highest.** The one 369,888-byte floor call is about 28%
191
+ of a 20 times budget at 64 KiB, so a large case whose highest call lands on such a probe outlier
192
+ reads it as the code's.
193
+
179
194
  ### Large cases
180
195
 
181
196
  A case whose single call takes longer than a warmup batch (50 ms) cannot settle by the scaling
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosyte/bench",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Benchmarks for the @cosyte/* packages: throughput, latency percentiles, memory, cold import time and loaded bytes, as versioned JSON, and a base against head comparison interleaved on one machine.",
5
5
  "keywords": [
6
6
  "benchmark",
@@ -57,11 +57,11 @@
57
57
  "tsup": "9.0.0",
58
58
  "typescript": "5.9.3",
59
59
  "vitest": "5.1.0",
60
- "@cosyte/test-utils": "^0.1.4",
60
+ "@cosyte/eslint-config": "^0.1.4",
61
61
  "@cosyte/prettier-config": "^0.1.2",
62
+ "@cosyte/test-utils": "^0.1.4",
62
63
  "@cosyte/tsconfig": "^0.1.2",
63
- "@cosyte/tsup-config": "^0.1.3",
64
- "@cosyte/eslint-config": "^0.1.4"
64
+ "@cosyte/tsup-config": "^0.1.3"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsup",