lumbda/examples
russell@unturf.com ccf86e3c3f rpc-chain-bench: Python → C relay → asm, timing end-to-end
Adds a transparent S-expression relay (examples/rpc-relay.lsp) plus a
sequential load generator (examples/rpc-chain-bench.lsp) and a bench
script (tests/rpc-chain-bench.sh) that wires them into multi-hop
chains across runtimes.

The relay is pure byte-forwarding: tcp-accept, tcp-recv, tcp-connect
to backend, tcp-send, tcp-recv reply, tcp-send back. Never parses.
Which is the point — S-expressions are the envelope.

Same rpc-relay.lsp runs as relay in any impl; chains are arbitrary
combinations of {Py, C, asm} nodes.

Measured (200 requests, ping, same laptop):

  (A) Py client → asm backend            direct, 1 hop   2061 rps
  (B) Py client → C relay → asm          2 hops          1234 rps
  (C) Py client → Py → C → asm           3 hops           766 rps
  (D) asm client → Py → C → asm          3 hops           796 rps

Per-hop cost ≈ 600-700 µs/request (TCP round-trip + context switch).

Safety: every server spawn used the six-layer pattern from CLAUDE.md
(ulimit -v 512MB + timeout 30 + trap + explicit kill + pgrep verify).
Four benchmark cells × up to 3 servers each = 10+ server spawns.
Zero strays, zero safety-net activations.
2026-04-17 09:18:42 -04:00
..
fibonacci.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
generator.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
http-client-bench.lsp heap-snapshot + native HTTP client + MOAD-0001 cleanup 2026-04-16 20:49:32 -04:00
http-server.lsp heap-snapshot + native HTTP client + MOAD-0001 cleanup 2026-04-16 20:49:32 -04:00
mergesort.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
objects.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
portal-prime.lsp Add portal: serialize and resume VM state across machines 2026-04-13 19:00:11 -04:00
repl-server.lsp S-expressions over sockets — RPC + remote REPL in portable Scheme 2026-04-17 09:00:04 -04:00
rpc-chain-bench.lsp rpc-chain-bench: Python → C relay → asm, timing end-to-end 2026-04-17 09:18:42 -04:00
rpc-client.lsp S-expressions over sockets — RPC + remote REPL in portable Scheme 2026-04-17 09:00:04 -04:00
rpc-relay.lsp rpc-chain-bench: Python → C relay → asm, timing end-to-end 2026-04-17 09:18:42 -04:00
rpc-server.lsp S-expressions over sockets — RPC + remote REPL in portable Scheme 2026-04-17 09:00:04 -04:00