Skip to content

Use smaller keys in language service caches #6028

@cartermp

Description

@cartermp

#5944 was closed after #6001 came in because we have a different way that source files are passed into the language service, eliminating a large amount of allocations. However, these caches:

https://github.com/Microsoft/visualfsharp/blob/4b7ea0805935112cfaad884dadb7b1af17cdf190/src/fsharp/service/service.fs#L2472

https://github.com/Microsoft/visualfsharp/blob/4b7ea0805935112cfaad884dadb7b1af17cdf190/src/fsharp/service/service.fs#L2455

https://github.com/Microsoft/visualfsharp/blob/4b7ea0805935112cfaad884dadb7b1af17cdf190/src/fsharp/service/service.fs#L2999

All still end up storing an entire source file as a part of a key. This keeps large strings around needlessly. Instead, we should use a hash code (or some hash-like representation of the source) that we use as a part of the key. This should help further relieve memory pressure for larger solutions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions