From: Spencer Collyer (spencer_at_[hidden])
Date: 2006-03-07 11:21:56
On Mon, 06 Mar 2006 11:25:49 -0600, Nigel Stewart wrote:
> >> Caching is one of the fundamental ways to achieve improved
> >> performance. I'm a bit surprised it hasn't been more of a topic in
> >> Boost discussions, or in computer science in general.
> Here is an application for a C++ LRU datastructure
> in computer graphics:
> In a nutshell, the datastructure is a fairly generic arrangement
> of std::list and std::map, but the replacement policy is fairly
> Related to this was some activity towards a boost circular buffer
> container... Which is something I intend to revisit, some shiny
I developed a similar data structure for an LRU cache a while back. It
is fairly basic - all you can do with it is check if a value exists, and
add a value, but that was all that was required when I wrote it. The
maximum size of the cache is determined at construction time.
I did consider adding the ability to chain caches together, so you could
have a small primary cache to test first, with a bigger secondary cache
backing it up, but the amount of work involved compared to the
prospective gain didn't seem worth it at the time.
-- <<< Eagles may soar, but weasels don't get sucked into jet engines >>> 4:12pm up 82 days 23:54, 27 users, load average: 0.00, 0.00, 0.08 Registered Linux User #232457 | LFS ID 11703