Skip to content

Enabling LRU for tracked functions leads to lock-congestion #1032

@MichaReiser

Description

@MichaReiser

We tried to enable LRU for some tracked functions in ty but it resulted in a 25% performance reduction when running ty multi-threaded. The root cause is that the LRU linked list uses a single Mutex, which becomes a bottleneck for very hot queries, because all threads end up blocking on it.

We should explore whether we can shard the LRU lock in a similar way to how we do for interned structs. This should dramatically reduce lock congestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions