Hi all,

I've been looking at DNS caching recently, and based on that, have
made some improvements on top of the TTLCache in core.cache which I
think I'm ready to release - they're at
https://github.com/rkday/ttlcache and
https://clojars.org/uk.me.rkd.ttlcache.

The main improvements are that you can specify a function to extract
TTLs from the cached values (useful for DNS etc. where each record
comes with its own TTL), and that I'm using a priority queue to make
expiry faster when only a few items are expiring. In the best case
(where no items expire and it's O(1) rather than O(N)), it seems to be
150-200x faster on a 5,000-item cache.

I'd appreciate any feedback on whether people think this is a useful
type of cache, how big a problem it is to be slower when expiring
large numbers of items, and whether I've got the benchmarks and big-O
analysis right or whether there's something simple I've missed.

Thanks!
Rob

P.S. I don't think this is yet in a state where I can open a JIRA
request and try and get some of the improvements back into core.cache
- mainly because it's slower when expiring large numbers of keys from
the cache at once. But that's definitely something I'd like to do in
the future if I can speed that up, or if people feel that's an edge
case.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to