Questions tagged [cache]

A cache is a component that transparently stores data so that future requests for that data can be served faster.

Filter by
Sorted by
Tagged with
15
votes
2answers
1k views

Lock-free cache oblivious n-body algorithm

I'm currently looking at, from a rather high level, the parallelization of the gravity calculation in an N-body simulation for approximating a solution to the N-body problem. The simple form of the ...
3
votes
3answers
2k views

Public property, backing up by a private field, with caching and null checking inside

I have a private field called individualProfile (camelCase) and I've created a public property called IndividualProfile (...
8
votes
2answers
1k views

Last-recently-used (LRU) cache container class

I've written a cache class which implements a last-recently-used (LRU) cache. I would like to know what you think about it and whether it's worth using it or not (due to performance issues for ...
1
vote
1answer
164 views

Does this function cache correctly? [closed]

I want to limit the load so I rewrite the most expensive method and add caching, both memcache and cache-control: ...
4
votes
1answer
6k views

An LRU cache template

I recently implemented a cache for a pet project of mine. The main objectives behind this implementation were: Support move-only types for values: C++11 is here, and some of the objects that will be ...
0
votes
1answer
219 views

Iteration and memcache for selected categorized random elements

The following code is a quick implementation since I only needed 3 random images sorted by category (a random eyes image, a random nose image and a random mouth image and then combine them): ...
4
votes
3answers
2k views

Static class member destruction in C++

I have a basic cache set up. Whenever a user requests a bitmap, it fetches or loads it from disk if it isn't already loaded, significantly reducing load times. Currently, the design explicitly tells ...
3
votes
1answer
671 views

Possible solutions to remove the use of a Hashtable

While this is working very well for storing setting variables for my applications, I've been using it for a number of years and really feel there is something better. I'm perhaps just looking to use ...
11
votes
3answers
15k views

LinkedHashMap as LRU cache

I have a simple implementation for a LRU cache using LinkedHashMap. I want it to be as generic as possible. This is not for production use, just practice, so I ...
7
votes
1answer
1k views

Object cache storage for Rails

I want to have fast cache in which I want to keep all my nomenclature data. I don't want to go with Memcached because I have to do serialize/de-serialize on each object which is slow. So I choose to ...
12
votes
4answers
315 views

Test case for a caching library

This shows a test case for an old caching library that I use for a project. It features simple save/load/delete functions (sadly static calls) but what I want to focus on is the test code written for ...

1 2 3 4 5
6