Closed jarle closed 6 years ago
Is there a natural time to remove items from the cache? I'm not sure it will really matter because we're talking about a set of hundreds of small objects whose contents don't change much over the lifetime of an Atom window. But it's worth considering. @leroix I think I'm cool with this but I'd love to get your sign-off as well.
Oddly enough, the caching using WeakMap
works just fine in 1.21.0-beta0
, but not in 1.20.0
.
Comparison toggling command palette 5-6 times(no manual GC):
1.21.0-beta0
:
1.20.0
:
Turns out I was running an outdated version of atom, so #94 should work as intended without this PR :smile: I will add a test case for keeping the cache between launches in a separate PR, just in case.
This PR fixes a problem from #94 where the item element cache was not utilized properly between palette toggles.