-
Notifications
You must be signed in to change notification settings - Fork 185
refactor: Remove tracked structs from query outputs #969
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
refactor: Remove tracked structs from query outputs #969
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #969 will improve performances by ×3.4Comparing Summary
Benchmarks breakdown
|
This looks promising :) |
The results on ty's benchmarks aren't as impressive but still a solid 1-3% performance win and a reduction in memory usage. |
309015a
to
803dd10
Compare
The memory usage, for posterity: astral-sh/ruff#19843 (comment) |
803dd10
to
53be770
Compare
Uhhm, why? |
I don't get it. It seems that now there's a huge regression after I rebased past the persistence changes but they shouldn't matter? |
d082632
to
b9d7340
Compare
I can't reproduce this regression locally or in ty. I'm not sure what's up here with codspeed I'm sure something changed but it isn't clear what and I wonder if it's just because it now sees the |
c388092
to
c7b2d70
Compare
c7b2d70
to
6a63bff
Compare
Hmm, I think this introduced a subtle regression regarding fixpoint iteration. Before: Salsa seeded the Now: Salsa seeds the Now, this is sort of a pre-existing issue for queries that aren't cycle heads because they already had the behavior that we now observe for cycle heads too. |
We currently store tracked structs twice:
QueryRevisions::origin
(as an output): This is mainly for historic reasons because tracked structs required to be verified (mark_validated_output
), but that's no longer the case since we're using generational ids.QueryRevisionExtras::tracked_struct_ids
: To get the tracked struct ID for a given tracked struct in a later revision (we want stable ids for better incrementality).This PR removes tracked struct ids from
origin
. It requires tracking in theIdentityMap
whether a tracked structwas created in this revision (or if it's an entry from a previous revision but the tracked struct wasn't recreated)
so that we can remove now stale tracked structs in
diff_outputs
.This should help reduce memory usage and potentially even improve performance because
it removes the
active_query.add_output
call for tracked structs anddeep_verify_memo
no longer has to iterate over tracked structs.