Skip to content

Within-revision LRU collection for queries returning values with lifetime &'static #1367

@MichaReiser

Description

@MichaReiser

Salsa's fixpoint iteration is a very convenient feature to handle recursive queries as seen in astral-sh/ruff#20477. The caching of some of the type operations can also help with performance.

However, queries like is_redundant_with come at a high memory cost because there are simply so many instances that need to be cached.

We should explore adding within-revision LRU garbage collection to Salsa for queries that return values with lifetime &'static (and don't return references). That is, values that are copied or cloned and, thus, collecting them in salsa can't lead to dangling references.

Metadata

Metadata

Assignees

No one assigned

    Labels

    memoryrelated to memory usage

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions