-
Notifications
You must be signed in to change notification settings - Fork 152
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
Assign memo ingredients per salsa-struct-ingredient, not globally #600
Comments
Mentoring instructionsCurrently 'memo ingredient indices' are a vector; the values in the vector are the fn ingredient indices that would be storing the memo (this should be documented!). Lines 122 to 123 in 710691d
This should be changed into a map of vectors, indexed by the "salsa struct ingredient index" (the ingredient index on which the memo is stored): /// Map from the [`IngredientIndex`][] of a salsa struct to a list of
/// [ingredient-indices](`IngredientIndex`)for tracked functions that have this salsa struct as input.
memo_ingredient_indices: RwLock<Map<IngredientIndex, Vec<IngredientIndex>>> then we modify Lines 300 to 305 in 710691d
This is called my the various code in salsa-macro-rules, so that will have to be modified to pass in the ingredient index for the salsa struct on which the function is invoked. We also modify Lines 291 to 296 in 710691d
and change the one caller of that last method: https://github.com/salsa-rs/salsa/blob/master/src/tracked_struct.rs#L504 to pass in the |
@ibraheemdev you expressed interest in this task. Let me know if you start working on it so that I can assign it to you. |
We had some interest/demand from rust-analyzer contributors to contribute to Salsa and @ShoyuVanilla expressed interested in this work. I also believe that he has bandwidth to work on this sooner than @ibraheemdev and memory usage is a concern for rust-analyzer, so for those reasons, I'd like to assign him to this issue. |
Today every tracked function gets assigned a distinct
MemoIngredientIndex
. These are used to index into the memo table attached to a salsa struct. But every function can be attached to salsa structs of exactly one kind, so indices only have to be distinct per salsa struct, not globally. This would save a lot of space in larger projects.The text was updated successfully, but these errors were encountered: