-
Notifications
You must be signed in to change notification settings - Fork 175
Simple LRU garbage collection for interned values #839
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
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #839 will degrade performances by 16.81%Comparing Summary
Benchmarks breakdown
|
b500f7e
to
b54e365
Compare
Interesting. I suspect this is new but I'm investigating a similar issue related to interned in cycles |
That makes me wonder if your PR might help to come up with simpler repros for the fixpoint issues that we're seeing. I should give this a try tomorrow. On the perf side. You could try using the |
I quickly tried the branch in Red Knot but I also got new panics that we didn't see before. That makes me suspect that some revision tracking might be off in this PR? What I like to do to debug those issues is to compare the tracing output and see where things go different |
I think the issue is unrelated to durabilities but about interned query arguments. If a query takes an interned struct as an argument then an older memo may be incorrectly verified after the slot has been reused, but the IDs still match. I think we have to check that the memo and first_interned_at revisions match to avoid this, but I'm not exactly sure where that would be. |
I think I understand. What you're saying is that I think will need something similar to what we have in tracked structs where salsa informs other ingredients that the memo was collected so that they can free resources as well if necessary: The second part in tracked struct that protects against this is that we separately track |
073a988
to
7f89c28
Compare
3ac564d
to
a232751
Compare
I updated the PR to add read dependencies and clear memos on reuse (I believe we will need to defer reclamation of the memos), but there are a still some ty tests failing that I'm unsure about. |
39c219b
to
bcb023c
Compare
Hmm I'm not sure we can remove the read dependency on creation with generational IDs, we still need |
No, I don't think we can remove it from the writing query. We need the dependency to ensure the interned value gets re-created when it was claimed previously |
Basic implementation of #597.
The garbage collection strategy used here is very simple.
I'm concerned about a few things, so leaving this as a draft for now.
Data was not interned in the latest revision for its durability
. I'm not sure exactly why this is happening, but I suspect it's related to durabilities.