Skip to content

Conversation

@tilladam
Copy link
Contributor

@tilladam tilladam commented Jan 5, 2026

  • Add divan benchmarks for compiler semantic analysis phase (internal/compiler/benches/semantic_analysis.rs)
  • Add custom allocator to track allocations in the benchmark.
  • Add benches for individual phases of compilation and a proc-macro simulation mode.

Benchmarks cover:

  • Lexing and parsing performance
  • Full compilation with various stress scenarios
  • Specific hotspots: many children, properties, exports, states, nested components, deep expressions, binding chains

The optimization doc identifies key issues:

  • O(n²) export sorting
  • Element duplication in inlining pass
  • Incremental Vec growth patterns
  • SmallVec sizing recommendations

@tilladam tilladam force-pushed the compiler-benchmark branch from b2a065a to bcaf099 Compare January 6, 2026 10:19
- Add divan benchmarks for compiler semantic analysis phase
  (internal/compiler/benches/semantic_analysis.rs)
- Add custom allocator to track allocations in the benchmark.
- Add benches for individual phases of compilation and a proc-macro simulation mode.

- Document allocation hotspots and optimization strategies
  (docs/semantic-analysis-optimization.md)

Benchmarks cover:
- Lexing and parsing performance
- Full compilation with various stress scenarios
- Specific hotspots: many children, properties, exports,
  states, nested components, deep expressions, binding chains

The optimization doc identifies key issues:
- O(n²) export sorting
- Element duplication in inlining pass
- Incremental Vec growth patterns
- SmallVec sizing recommendations
@tilladam tilladam requested a review from dfaure-kdab January 22, 2026 20:19
@tilladam tilladam changed the title Add semantic analysis benchmarks and optimization documentation Add semantic analysis benchmarks Jan 22, 2026
@dfaure-kdab dfaure-kdab merged commit f643b49 into slint-ui:master Jan 22, 2026
41 checks passed
@tilladam tilladam deleted the compiler-benchmark branch January 22, 2026 21:43
burhankhanzada pushed a commit to burhankhanzada/slint that referenced this pull request Jan 28, 2026
* Add semantic analysis benchmarks

- Add divan benchmarks for compiler semantic analysis phase
  (internal/compiler/benches/semantic_analysis.rs)
- Add custom allocator to track allocations in the benchmark.
- Add benches for individual phases of compilation and a proc-macro simulation mode.

Benchmarks cover:
- Lexing and parsing performance
- Full compilation with various stress scenarios
- Specific hotspots: many children, properties, exports,
  states, nested components, deep expressions, binding chains
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants