You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My primary use case is to give control to the developer over the caches that the memo function would use for function memoization. For example, Python offers a LRU policy with a customizable limit.
We have a lot of pressure, from my observations, of large and "expert" apps asking for GC hooking points and GC info to be exposed for the purpose of writing userland caches. They might misguidedly use WeakRefs right now, which, with a “maybe clear on every GC”, is a particularly bad cache eviction policy. One realization the V8 team has had recently is well, maybe there's space for directly designing caches instead of exposing GC stuff, which seems blech. […] I have not thought yet deeply about if LIFO and FIFO with a simple size are sufficiently flexible eviction policies. [Use cases would include] roughly, the same kind of things Java's soft reference and prio references tried to solve.
Userland caches with gc-hooks has come up on our side internally as something people are really asking for. Not convinced but it keeps getting mentioned. We also had the thought “what if we provided a cache instead”.
We need to come up with specific isolated illustrations of these use cases and check if they would be adequately served by Map-like data structures with constant limits.
The text was updated successfully, but these errors were encountered:
My primary use case is to give control to the developer over the caches that the memo function would use for function memoization. For example, Python offers a LRU policy with a customizable limit.
@syg from V8 said:
@rickbutton added:
We need to come up with specific isolated illustrations of these use cases and check if they would be adequately served by Map-like data structures with constant limits.
The text was updated successfully, but these errors were encountered: