Skip to main content

Questions tagged [cache]

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

7 votes
3 answers
803 views

I’m implementing a templated LRU cache in C++17 and C++20. High-level design: Recency: ...
sam's user avatar
  • 503
9 votes
2 answers
463 views

LRU cache is a classical design pattern frequently questioned in programming technical interviews. It is best illustrated with pictures. Here are two examples. The following are two alternative ...
bobeff's user avatar
  • 190
9 votes
2 answers
875 views

I'm unsure whether the following is thread safe. I want to say it is because the static state is only assigned to within the lock. However I'm more of a js programmer so this is out of my comfort ...
aaaaaa's user avatar
  • 221
2 votes
2 answers
94 views

I've been working on the classic LFU (Least Frequently Used) cache running in O(1) time problem lately and, as a student, I kind of struggled with the algorithms I found online. I got most of the idea ...
NicolaM94's user avatar
5 votes
2 answers
2k views

I have a Dockerfile with ubuntu:22.04 as a base image and a manual Python installation(specific version i.e., 3.11.1) layer which takes a long time. Approach 1: ...
shaik moeed's user avatar
2 votes
2 answers
597 views

I have a Web API and for some requests we are sending requests to a third party API that requires request authentication. It's a simple bearer token, which I'd like to reuse across requests, because ...
Prolog's user avatar
  • 273
3 votes
1 answer
277 views

The requirements are: evict any expired items find the items with the lowest priority and evict the least recently used one Any feedback would be appreciated. ...
random_letter's user avatar
0 votes
2 answers
633 views

I'm using SQLite3, via php's extension module, to create a persistent object cache for WordPress. It's intended for use on modestly sized sites that don't have access to redis or memcached. Why use ...
O. Jones's user avatar
  • 329
2 votes
2 answers
177 views

I'm creating a cache system for an object (Mesh) that is expensive to create. A Mesh can be created using a small amount of ...
Joshua Hyatt's user avatar
0 votes
1 answer
118 views

I have json data in a file and I want to load the file content only once when application is initiated instead of calling the loading file multiple times in class instances. I created a config which ...
ParthS007's user avatar
  • 207
1 vote
1 answer
96 views

A couple days ago I posted my first implementation of my data structure here, which implements a cache-optimized tensor representation. I have worked the ideas from the responses into my ...
finlay morrison's user avatar
3 votes
3 answers
372 views

There is an updated version of this code with some of the recommended changes made here. I have created an implementation of a multi-dimensional array which utilizes a single continuous memory buffer ...
finlay morrison's user avatar
2 votes
2 answers
188 views

Trying to design a threadsafe lru cache using a reentrant lock. Currently I don't like the tryLock in a loop approach. Any inputs on making it more optimal in terms of concurrency? ...
DntFrgtDSemiCln's user avatar
3 votes
2 answers
270 views

I have a use case where I want to keep a pre-compiled regex, cached, for performance reasons, but the regex pattern also needs to be updated infrequently. Instances of CachedRegexFilter class will be ...
Dexter's user avatar
  • 435
0 votes
1 answer
171 views

I have solved this LeetCode problem. Depending (perhaps) on the server load, I once scored the following performance figures: My code follows: ...
coderodde's user avatar
  • 32.3k

15 30 50 per page
1
2 3 4 5
19