Files
turso/scripts
Jussi Saurio e74f903c2f scripts/stack: add tools to measure stack frames and stack use
Parsing and translating an expression recurse once per level of nesting,
so the frame size of those functions decides how deep an expression can
be on a given stack. There was no way to see those sizes or where the
stack goes at the deepest point.

- frame-sizes.sh reads the frame size of every function from its prologue
  (aarch64 and x86_64), and compares two binaries with -c.
- min-stack.sh finds the smallest main-thread stack that runs SQL scripts,
  per binary, with sqlite3 as a reference.
- stack-profile.sh runs a script under lldb with a stack just too small,
  so it overflows at its deepest point, and sums the stack bytes per
  function from the stack pointers of the backtrace.

stack-profile.sh starts the binary through a small C launcher that sets
the stack limit and then execs, because lldb's debug server cannot run
under a small `ulimit -s` and lldb cannot debug a system shell on macOS.
2026-10-05 15:52:51 +03:00
..
2025-09-10 15:00:08 +03:00
…
2026-02-24 17:04:39 +02:00