Parent: #459
Depends on: #460, #461, #465, #479, #481
Goal
Optimize lexing, parsing, AST/bytecode generation, source evaluation, and module compilation for cold and dynamic code without hiding compilation outside timed boundaries.
Scope
- Add source-size/syntax-mix benchmarks for scripts, modules, functions/constructors, direct eval, dynamic import, JSON-like literals, classes/private fields, async/generators, Unicode identifiers/strings/templates, regex literals, and invalid syntax diagnostics.
- Attribute lex/token storage, AST allocation/layout, scope analysis, bytecode emission, constant/name tables, source maps/locations, debugger registration, optimizer metadata, and allocator/GC pressure.
- Reduce passes/allocations and improve locality; consider direct bytecode emission or compact transient IR only with exact diagnostics, early errors, source ranges, and tree-walker availability.
- Reuse immutable parse/compile artifacts only with exact source/options/realm/dynamic-scope keys and bounded lifecycle.
- Optimize streaming/module compilation incrementally while preserving failure atomicity and exact final bytes.
No-workaround rules
- No precompiled benchmark source, omitted source locations/debug metadata, delayed syntax error, reduced Unicode/Annex B/module behavior, hash-only cache collision risk, or third-party parser/compiler.
Acceptance
Foundation
Current pipeline: src/lexer.zig → src/parser.zig/ast.zig → src/compiler.zig/bytecode.zig; module streaming work under #406–#410.
Parent: #459
Depends on: #460, #461, #465, #479, #481
Goal
Optimize lexing, parsing, AST/bytecode generation, source evaluation, and module compilation for cold and dynamic code without hiding compilation outside timed boundaries.
Scope
No-workaround rules
Acceptance
Foundation
Current pipeline:
src/lexer.zig→src/parser.zig/ast.zig→src/compiler.zig/bytecode.zig; module streaming work under #406–#410.