edussss on 10-15, running `go test -tags nogui ./...` for #1928 at load
average ~190: TestTOMLBigFileParsesInLinearTime went red, a 3 MB file
took 1.272s against the 1s bound. Rerun alone it passes. The parse was
still linear; the bound was not.
The check now parses a 2 MB and an 8 MB file three times each, keeps
the fastest of each, and requires the 8 MB time to stay under 8 times
the 2 MB one. Load slows both parses together, so their ratio holds
where a wall-clock second does not. The code standards' "a timing test
leaves room on both sides" asked for exactly this: measured here, the
linear parse's ratio is 3.7 to 4.5, and the quadratic parse the test
guards against, which counts each key's line from the top of the file,
needs 16 times the time for the 4 times bigger file. 8 sits between
the two, far from both.
What was run:
- go test -tags nogui ./internal/edit/: ok
- the fixed test with -count=3: ok (6 runs)
- a local quadratic tomlShaper (per-key line scan, the behavior
2a4042a9 removed): the ratio reads 16.0x (2 MB 5.3s, 8 MB 1m25s)
and the test goes red; reverted after
- gofmt -l internal/edit/: empty
- go vet -tags nogui ./internal/edit/ at GOOS=windows and GOOS=linux
(the latter CGO_ENABLED=0; the local macOS SDK has no glibc, so the
cgo path of a dependency cannot be vetted here): clean
No .github/, site/ or go.mod/go.sum file is touched.
Co-Authored-By: Claude Code <noreply@anthropic.com>