-
Notifications
You must be signed in to change notification settings - Fork 660
perf(rome_js_semantic): POC: reduce semantic model writes #3569
Conversation
!bench_analyzer |
@xunilrj do you want to take this over as you have the most knowledge about the semantic model? My implementation works but isn't very clean. I'm also undecided on what approach is best for What would be nice is if we could avoid the many nested |
Analyzer Benchmark Results
|
b2831b7
to
6e0f2df
Compare
Improve the performance of the semantic model by writting less data: * Only store the nodes that can be queried by the semantic model * Only store declaration reads/writes once instead of twice ## Alternatives: Keep `declaration_all_writes` and `declaration_all_reads` and compute `declaration_all_references` by concatenating the two list. Downside: Doesn't maintain read/write order Upside: Cheaper read of reads/writes because it doesn't require any filtering
9771f1d
to
86c0d9f
Compare
✅ Deploy Preview for docs-rometools canceled.
|
!bench_analyzer |
Analyzer Benchmark Results
|
@@ -101,7 +112,50 @@ impl Visitor for SemanticModelBuilderVisitor { | |||
) { | |||
match event { | |||
WalkEvent::Enter(node) => { | |||
self.builder.push_node(node); | |||
match node.kind() { |
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.
This is a good idea.
I thought this initially. Not sure if this makes a huge difference. Will test here. The picking of the nodes I liked. Makes sense. |
I think it roughly showed 2% improvement for each removed collection (so 4% in total) |
This PR is stale because it has been open 14 days with no activity. |
I incorporated these suggestions at #3825. |
Improve the performance of the semantic model by writing less data:
Yields a 5-10% perf improvement
Alternatives:
Keep
declaration_all_writes
anddeclaration_all_reads
and computedeclaration_all_references
by concatenating the two list.Downside: Doesn't maintain read/write order
Upside: Cheaper read of reads/writes because it doesn't require any filtering
Summary
Test Plan