Project

Roadmap

Explore the planned Topaz 5.21.2 performance improvements and follow their release results in History.

See which improvements are planned for Topaz and what they would change for your projects. For released changes, read History.

Planned version 5.21.2

5.21.2 is planned as one compatible performance patch. The patch aims to reduce compiler work while preserving language syntax, accepted programs, diagnostics, evaluation order, and runtime results.

The five improvements below form the initial scope. Measurements will determine which implementations are worthwhile. Release timing and speed improvements will follow actual results.

Reuse type and import lookups

Programs with many type references or imports can repeatedly search the same declarations. The compiler will reuse lookup results within the appropriate module and scope.

This should reduce repeated searches as a project grows. Private declarations, shadowing, nominal type identity, and import cycles must keep their existing behavior. Changes to a module must invalidate affected results.

Cache syntax references

The compiler will reuse links from syntax nodes to their declarations instead of repeatedly walking the same syntax tree. This targets repeated name and expression analysis within a compilation.

References must remain local to the correct program and revision. Incomplete cyclic imports must remain distinguishable from names that do not exist, so caching cannot hide an error or change its location.

Reduce temporary compiler arrays

Reading expression operands and labels can create temporary arrays that are immediately discarded. The compiler will access existing data directly where it can preserve the same traversal.

The aim is to reduce allocation and copying during compilation. Operand order, single evaluation, diagnostic order, and early termination must remain unchanged.

Reduce seed JSON conversions

The bootstrap seed exchanges compiler requests and responses through JSON. The plan removes redundant parsing and serialization inside that exchange while keeping the public input and output format.

This targets the cost of rebuilding the compiler from its seed. UTF-8 handling, input limits, errors, and the generated program must remain unchanged. Total time and memory use will determine whether a change is retained.

Simplify generated Rust expressions

Deeply nested generated expressions can increase the work required by Rust to compile a Topaz program. The generator will split suitable expressions into explicit intermediate steps.

The goal is to reduce syntax nesting and compilation work. Evaluation order, temporary lifetimes, borrowing, cancellation, and error propagation must remain correct. Reformatting long lines alone does not satisfy this goal.

Improvements under review

Four additional areas may join the patch when measurements identify a relevant bottleneck.

  • Reduce JSON conversion around compiler steps when conversion dominates the step itself.
  • Reduce diagnostic sorting work while preserving the first error, ordering, limits, and early termination.
  • Reduce named-argument preparation while preserving argument ownership, defaults, and single evaluation.
  • Reduce asynchronous call overhead where synchronous execution preserves deadlines, cancellation, and host interaction. Unknown calls retain their dynamic behavior.

Improvements to typed records, enums, collections, and call representation are also under review. Parts with demonstrated benefits and preserved compatibility may join the same patch.

Follow the plan through release

Each version and improvement on this page has a stable link. When 5.21.2 ships, its History entry will link to this plan, and the included improvements here will link to their released results.

If an improvement is omitted or its scope changes, this page will explain why and update the active plan. Measurements, regressions, compatibility requirements, and urgent fixes can change the scope. History records what has actually shipped.