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.

9 votes
2 answers
434 views

Simple LRU cache implementations in C++20

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
870 views

Thread safe cache to sql call in c#

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
90 views

LFU cache in Kotlin

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

How to reduce the build time of Docker image layer in GitHub Actions?

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
576 views

Thread safe accessing memory cache using semaphore

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
272 views

Expirable LRU cache

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
630 views

Configuring SQLite3 for best efficiency as a persistent cache

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
176 views

Cache for mesh objects

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
117 views

Loading the file only once in application [closed]

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
93 views

Implementation of a multi-dimensional array as a single memory buffer [Part 2]

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
364 views

Implementation of a multi-dimensional array as a single memory buffer

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

Threadsafe LRU Cache

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

Thread-safe cached compiled Regex

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
165 views

LeetCode - LRU Cache by rodde

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
  • 31.9k
2 votes
1 answer
458 views

Asp.Net Core CacheKey Management

I created cache management structure for Asp.Net Core and Redis. But i dont know is this best practices or bad. My Github Repo First one is Store my entity keys class is ...
filiphasan's user avatar

15 30 50 per page
1
2 3 4 5
19