Stage 06 · Performance
Measure first, then remove the right work
Compatibility stayed fixed while profiling exposed collection copying, repeated name normalization, registry cloning, and source handling on the warm request path.
Correctness is the fence
Every optimization runs behind tests for copy-on-assignment, explicit references, frozen values, member argument order, dynamic tag shadowing, persistent globals, all 1,572 feature contracts, and the real framework demos. A faster answer is not an improvement if old Lasso code can observe a different answer.
What changed
Stable collection receivers can now mutate in place when arguments are free of effects. Calls and members keep compiler-normalized names. Literal variables and safe arithmetic take direct paths. Regular expressions, custom-tag bodies, parameter metadata, the syntax profile, and the complete Lasso 8.6 binding registry share bounded or immutable worker storage.
The current source path also reuses metadata-validated immutable page text and a precomputed content fingerprint. File edits remain visible, cache churn is bounded, and Compiler_RemoveCachedDoc evicts both source and compiled entries.
What the numbers say
Across 13 matched language workloads, LaiRu now has 5.50 times its original aggregate throughput, although PHP remains 33.94 times faster by geometric-mean latency. On the complete persistent FastCGI fixture, LaiRu’s median is 0.172 milliseconds against PHP-FPM’s 0.092 milliseconds: a much narrower 1.86-times latency gap.
Original Lasso changes the picture
The same 13-case Lasso source and checksums were also run against Original Lasso 8.6.3 on Rocky Linux. LaiRu delivers 2.95 times the vendor runtime’s geometric-mean throughput, while Original’s median application latency is 3.37 times LaiRu’s. This modern-host result is the published vendor reference; older-platform evidence remains an internal diagnostic rather than a deployment recommendation.
Cross-platform behaviour
The complete 1,572-case LaiRu output was also compared between Rocky Linux and Debian. There were no platform deviations or request failures: 1,510 observations matched byte for byte and 62 exposed deliberately different datasource, filesystem, host, or request configuration. The former platform-independent Original-Lasso deviation list has also been worked through: valid language contracts now match, and prerequisite or diagnostic cases are explicitly classified.
What comes next
The long-term direction is representative work within roughly five times PHP, but wall-clock speed is only one release dimension. The next stage attributes request time by phase and records allocations, cold and warm RSS, cache high-water marks, compilation size, p50/p95/p99 latency, saturation, queueing, and recovery.
That evidence gates a sequence of ownership and representation work: separate persistent worker state from request state, intern bounded compiler names, introduce hybrid indexed variable slots, then lower proven instruction families to a compact interpreter with an explicit AST fallback. Framework pages, dynamic definitions, references, diagnostics, security boundaries, and all 1,572 contracts stay semantic fences throughout.