perf(v4): POST at a boot's pace -- v3's per-suite put-back, and a lookup that rejects by two bytes (#189)
Ruled (Captain Bob, 2026-11-14): "Find the TCG cost first". v3's whole POST took the amd64
accept from about 3 m 15 s to 8 m 45 s, and aarch64 past its 570 s (logs/20261114-091651,
STOPPED, committed). Profiled on the host (gprof, mesh-boot): 87% of the time in POST's
lines, about 280,000 opcodes a line -- the interpreter's dictionary lookup.
- POST puts the dictionary back before each of v3's suites, as v3's run_test_suite does
("to remove test-created words"): a mark, (POST), forgotten and made again
(V4_POST_SUITE). Only the dictionary: SCR, BASE and the rest stay as the cases left them.
- (LOOKUP) tries each entry by its count and first character first -- one fetch of the
name's first cell, masked -- and only then its hidden flag and the whole name. The answer
is the same; an entry that cannot be it costs a few opcodes, not some forty.
mesh-boot: 37.7 s -> 15.7 s, POST 990 of 990. make -C v4 test: all v4 tests passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
@@ -446,7 +446,10 @@ int main(void)
|
||||
&& tally.pass == runs && tally.fail == 0
|
||||
&& strstr(post_said, want_line) != NULL && strstr(post_said, "POST FAIL") == NULL,
|
||||
"and passes POST, which the kernel runs on her: %u of %u, %u failed; \"%s\"", tally.pass, tally.tests, tally.fail, post_said);
|
||||
CHECK(strcmp(tell(10, "RS1"), "42 42 \n") == 0, "while POST runs, what its cases define is on her: \"%s\"", printed);
|
||||
/* before each of v3's suites POST forgets the words of those before it, to its mark (POST), as v3 does:
|
||||
* what is on her now is the mark and the last suite's words; an early case's word is gone */
|
||||
CHECK(strcmp(tell(10, "' (POST) 0<> . RS1"), "-1 UNKNOWN WORD: 'RS1'\n") == 0,
|
||||
"while POST runs, what its cases define is on her, a suite at a time: \"%s\"", printed);
|
||||
CHECK(strstr(tell(10, "COLD"), "Cold Start") != NULL, "the kernel puts her back to the system as it was sealed");
|
||||
CHECK(hera->mem[DP] == before[DP] && hera->mem[LATEST] == before[LATEST], "HERE and LATEST are where they were before POST");
|
||||
for (k = 0; k < here; k++) if (hera->mem[k] != before[k]) { if (first < 0) first = k; changed++; }
|
||||
|
||||
Reference in New Issue
Block a user