Skip to content

'whitespace' become possibly overflow on 32bit architecture. - #1

Merged
yuin merged 1 commit into
yuin:masterfrom
mattn:fix-overflow
Feb 16, 2015
Merged

yuin merged 1 commit into
yuin:masterfrom
mattn:fix-overflow

Conversation

@mattn

@mattn mattn commented Feb 16, 2015

Copy link
Copy Markdown
Contributor

No description provided.

yuin added a commit that referenced this pull request Feb 16, 2015
'whitespace' become possibly overflow on 32bit architecture.
@yuin
yuin merged commit 80ac683 into yuin:master Feb 16, 2015
yuin pushed a commit that referenced this pull request Apr 1, 2026
pschlump added a commit to pschlump/gopher-lua that referenced this pull request Nov 1, 2026
cmd/luabench ported from glasm (11 scripts, 4 postures: interp / cold /
warm / vmcache, output-checked). Baseline + pprof recorded in
docs/Perf-P0-Baseline.md with the ×C calibration against glasm's
same-machine C 5.5.1 numbers.

Headline finding, revising the 2026-09 ranking by measurement: the
per-instruction context check (old yuin#9 "misc") is the yuin#1 cost in the
production posture — the warm leg runs 1.3-1.7x the ctx-free interp leg
on every compute lane; isolated A/B on h_numloop: no-ctx 114.5ms,
Background 148.7ms (+30%, nil-channel short-circuit), real cancelable
context 186.8ms (+63%). numloop warm is 22.2x C; ctx-free interp 13.8x.

P1a (amortized deadline check: back-edges + calls) promoted above P1 in
the plan — days of work reclaiming more than P1's whole estimated
10-25% on loop lanes. fib/callret profiles confirm register bookkeeping
and call overhead as the next costs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
pschlump added a commit to pschlump/gopher-lua that referenced this pull request Nov 1, 2026
The per-instruction ctx/budget select in mainLoopWithContext measured
+63% on h_numloop and 1.3-1.7x the ctx-free loop on every compute lane
(Perf-P0-Baseline.md Finding 1) — the yuin#1 production-posture cost. Now
probed every 64 instructions (deadlineCheckEvery countdown), plus one
probe at every G-call RETURN: a blocked G function (channellib's
reflect.Select races ctx) observes cancellation and returns NORMALLY,
and the old next-instruction probe was what converted that into the
raise — a bare stride let a <64-instruction tail exit successfully
(TestCancelChannelReceive/2). Suspended calls (yield) skip the probe;
their resume bookkeeping must complete. Contract unchanged: bare raise
text, daemon normalization to ScriptError{ctx, Line 0}; latency now
bounded by 64 instruction boundaries instead of 1.

Gates: go test . (goldens byte-exact, zero diffs), go test ./...,
-race ./host/ -count=2, race on channel/context tests, ultima
lib/scripting + lib/commands green, CGO_ENABLED=0 build.

benchstat A/B (3 reps/tree vs bc31b4f): warm numloop -35.6%, tco
-39.8%, fib -29.7%, nsieve -33.8%, callret -30.9%, hostfn -13.5%;
geomean over all 44 cells -18.49%. Interp legs flat (untouched).
Warm/interp gap closed to ~2%; numloop 22.2xC -> 14.6xC. Record:
docs/Perf-P1a-Deadline-Check.md; plan sequencing updated (P1 register
windows is now the top measured cost center).

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants