-
Notifications
You must be signed in to change notification settings - Fork 799
Add semantic analysis benchmarks and optimization documentation #10373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| )); | ||
| } | ||
|
|
||
| /// Phase 3: Load dependencies (style-base.slint and its deps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no style-base.slint in the repo or in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that snuck in from a refactoring later in the patch series. The one that acutally improves the benchmark ;). Will fix.
| // Benchmark just the import_component calls | ||
| let mut build_diags_to_ignore = BuildDiagnostics::default(); | ||
| let _style_metrics = spin_on::spin_on(loader.import_component( | ||
| "style-base.slint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, it's not just a comment, it's referred to here
| &mut build_diags_to_ignore, | ||
| )); | ||
| divan::black_box((_style_metrics, _palette)); | ||
| use super::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover? doesn't seem useful here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch order problem, yes. I wanted to present the benchmark separately from the changes, which apparently didn't quite work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess your reply was for the previous comment.
This one is about use super::*;
- 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
b2a065a to
bcaf099
Compare
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:
The optimization doc identifies key issues: