# Remove the global hashtable for tracked fns with >1 argument The current setup, today, in the happy path: ```mermaid flowchart TD Table Page Slot["Salsa struct instance"] Memo["Memo"] AccumulatedVal["Accumulated value"] Table -- indexed by high bits of Id --> Page Page -- indexed by low bits of Id --> Slot Slot -- indexed by function id --> Memo Memo -- hashmap keyed by accumulator id --> AccumulatedVal ``` Happy path is: ```rust #[salsa:tracked] fn some_fn<'db>(db: &dyn crate::Db, some_struct: SalsaStruct<'db>) ``` In this case: * `some_fn` has a unique index so you can look it up on `some_struct.memos` Two things Niko doesn't like * memo indexing is global * efficiency when you have !=1 argument ## Memo indexing is global Sad part about the happy path: ```rust #[salsa:tracked] fn fn_a<'db>(db: &dyn crate::Db, some_struct: StructA<'db>) #[salsa:tracked] fn fn_b<'db>(db: &dyn crate::Db, some_struct: StructB<'db>) ``` * instances of `StructB` do not need a slot for `fn_a`, but they have one anyway what we ought to do: * assign memo-indices per salsa struct type, rather than globally * maybe we want some way to have a *sparse* memo table * but I doubt it ## Eliminating interning * change the memo table to index to a (sorted) vector of memos * so you can iterate down and find the one for your arguments * would be nice to be able to have the tracked-fn pick how it wants to organize its memos * at most one (default if you have only 1 argument) * vector (default if you have !=1 arguments) * hashmap (opt-in for things that are very sparse)