TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Show HN: A LRU cache using go generics
57 points
by
_256
over 3 years ago
2 comments
_256
over 3 years ago
Collapse
This is a simple LRU cache I made to get my hands on generics which is available in the go 1.18 beta. Feedback is welcome :-)
评论 #29925230 未加载
评论 #29924929 未加载
morelisp
over 3 years ago
Collapse
> Feedback is welcome<p>You'll probably be a lot better off a) preallocating the elements so your memory is nicely contiguous, b) tracking indices and not pointers. If I wanted to pay 24b overhead per item I'd use an `interface{}`. :)
评论 #29927326 未加载
评论 #29932246 未加载