Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cache bound by weighted count #602

Open
Labels
enhancementNew feature or request
@dave-yotta

Description

i.e. if we know or approx the memory usage of each entry in Mb and want to bound the cache to X Mb. I see there's a fixed capacity internally on the concurrent dictionary - so probably not straightforward.

If we picked a suitable N for the capacity bound and did this psuedocode:

onUpdated += x => { total = Interlocked.Increment(x.Size); if(total > limit) lfu.Trim(currentSize*0.7); }
onRemoved += x => total = Interlocked.Decrement(x.Size)

any thoughts on the performance/stability?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /