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
It'd be cool if on the hot path instead of writing:
for $BIG__LOOP {
// do work
let x = gc.get() // gets a handle every loop -- potentially expensive
// operate on x
// drop x/the handle
}
You could use a struct to cache the handles:
let cache = HandleCache::new();
for $BIG__LOOP {
// do work
let x = cache.get(gc) // only gets the handle once, then caches it
// operate on x
}
// drop all the handles in the cache when it is dropped
We'd need to evaluate if this is ever potentially a footgun, but it would seem to provide more control over the whole collection process. (It also seems pretty straightforward to implement!)
Could be combined with #43 for a super fast hot path!!!
The text was updated successfully, but these errors were encountered:
It'd be cool if on the hot path instead of writing:
You could use a struct to cache the handles:
We'd need to evaluate if this is ever potentially a footgun, but it would seem to provide more control over the whole collection process. (It also seems pretty straightforward to implement!)
Could be combined with #43 for a super fast hot path!!!
The text was updated successfully, but these errors were encountered: