tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

73 lignes · 3898 octetsBrut · Historique

Performance: next steps

Ideas investigated in the performance epic (issue #191's follow-ups) and deliberately not landed, with the measurements that decided each. Instruction counts are user-space (LOUISE_THREADS=1 perf stat, deterministic to a few parts in 10^8 here); wall is best-of-N and indicative only. Written 2026-10-18, against the perf-long-tail branch.

Chunked / unrolled cons cells

What. Represent a list as chunks of several elements per heap cell (unrolled linked list, or a rope-like chunking), so map/filter/fold pipelines allocate and chase a fraction of the cells they do today. Expected win. The largest single one left in list code: lists and compare/lists spend most of their instructions allocating, writing and scanning one cell per element, and a 4–8× chunking could plausibly halve them. Why out of scope. It is a representation change, not an optimisation: std/list patterns, the Perceus reuse analysis, the interpreter and every user's match on lists all see the cell shape. Weeks of work and an ADR of its own.

Single-actor preemption elision

What. When an actor runs alone on its scheduler thread (no peers to preempt for), skip the reduction-counter decrement and the yield checks until a second actor arrives. Expected win. ADR 0046 measured the counter plus the checks at ~9% of fib's instructions; the share is similar in other call-heavy loops. Why out of scope. Preemption is a semantics property (latency bounds, drop-draining, the loom models), not a local code shape: "alone" changes under the running actor, and the checks must resume mid-loop, not at the next entry. Needs a design (how a arriving peer re-arms a running actor's checks, what it does to the done-when's preemption-latency bar) and an ADR before any code. A narrower variant was probed here and rejected: hoisting the counter into a local across a call-free self-tail-call loop (arith's sum_to) measured slower than the memory RMW (the store-backs cost more than the decl mem; jle saves), and deleting the check outright — the unsafe ceiling — did not move wall clock at all on that loop.

PGO / BOLT for generated code

What. Profile-guided optimisation (and possibly BOLT layout) of the generated C, as scripts/pgo-runtime.sh already does for the runtime archive. Expected win. ADR 0040 (Revision) lists it as future work behind fixed code alignment: build-to-build placement variance in ThinLTO swings identical binaries by percents, so PGO's real signal is only readable on a stabilised layout. Order per that ADR: alignment first, then PGO/BOLT, then re-measure. Why out of scope. Blocked on the alignment work, and it is a build-pipeline feature (profile collection, flag plumbing, cache keys), not a codegen change.

-march=native binaries

What. Compile generated C with the host's ISA extensions (LOUISE_CFLAGS="-O3 -march=native" does it today, per build). Expected win. Measured here: floats/compare/floats −19.3% instructions (auto-vectorisation), matmul −8.3%, dict −2.2%, the rest within ±0.5%. Real, but concentrated in float-heavy code. Why out of scope. Release binaries must stay portable — a binary built on one machine must run on another, so the default targets the baseline x86-64. Users who build locally for local use can set LOUISE_CFLAGS; making that discoverable is a docs/CLI question, not a codegen one.

-O3 for generated C (measured, kept at -O2)

Not a "next step" but a decided experiment, recorded so it is not re-run blindly: LOUISE_CFLAGS="-O3" against the release -O2 gives matmul −8.3% instructions, most other benchmarks −0.2…−0.5%, fib 0.0%, at ~2% larger binaries. Below the bar (a consistent ≥5% at same-or-smaller size); the default stays -O2, and LOUISE_CFLAGS remains the override.