mem: fix my previous bad commits, harden orderfile regen

I'm stealth adding these changes to the log-msg-limit branch/PR because...

This branch reverts a previous intentional change https://github.com/lightpanda-io/browser/pull/2690
which positively impacted memory usage. However #2690 did a couple things, and
changing `comptime msg: []const u8` to `msg: []const u8` was the most
insignificant. So, I was hoping this change would be ok, the real memory gain
of 2690 probably have nothing to do with the comptime message.

BUT, I wanted to make sure, so I re-generated the orderfile on this branch, to
get the CI report for an optimal build. And the memory went +4MB, which seemed
impossible. Turns out my local ../demo was in a weird state from some WebDriver
testing yesterday and nothing was ever executed. So the orderfile I generated
was meaningless.

So, I'm now (a) including optimized orderfiles for this branch and (b) making
regen.sh fail if the bench doesn't seem to successfully run
This commit is contained in:
Karl Seguin committed 2026-09-23 11:20:42 +08:00
1 parent 36f2a6cb96
commit f189f077b8
3 files changed
+18819 -9

No files matched your search

+4081 -8
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -29,6 +29,8 @@
# OUT scratch directory (default /tmp/orderfile-regen)
# RAMDIR tmpfs the binary is benched from (default /dev/shm)
set -euo pipefail
# profile() runs in a command substitution, which otherwise drops set -e.
shopt -s inherit_errexit
DEMO_DIR=${DEMO_DIR:-../demo}
RUNS=${RUNS:-100}
@@ -92,8 +94,12 @@ profile() {
set_fault_around 4096
"$ram" serve --insecure-disable-tls-host-verification > /dev/null 2>&1 &
local pid=$!
# This subshell's own trap: the script's cleanup doesn't know this pid.
trap "kill $pid 2> /dev/null || true" EXIT
sleep 1
(cd "$DEMO_DIR" && RUNS=$RUNS node puppeteer/cdp.js > "$OUT/bench.out")
# A bench that dies early still leaves a resident set, just the wrong one.
grep -q '^total runs' "$OUT/bench.out" || { echo "bench did not complete, see $OUT/bench.out" >&2; exit 1; }
sleep 2
python3 "$TOOLS/pagemap.py" "$pid" "$resident" >&2
local hwm
+14732 -1
View File
File diff suppressed because it is too large. Load diff