Questions tagged [cache]
A cache is a component that transparently stores data so that future requests for that data can be served faster.
278
questions
2
votes
2
answers
58
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 ...
1
vote
0
answers
108
views
How to reduce the build time/cache Docker image layer in subsequent GitHub Actions runs?
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. How to cache ...
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:
...
2
votes
2
answers
462
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 ...
3
votes
1
answer
243
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.
...
1
vote
0
answers
142
views
Thread-safe key-value cache with expiration
I need my cache hold items to be accessible by key. The items should disappear after a configured time period. I do not need the lifetime of items to be exactly as configured. All I need is to make ...
0
votes
2
answers
530
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 ...
2
votes
2
answers
123
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 ...
1
vote
0
answers
163
views
Caching tasks and removing them from the cache when faulted [closed]
Is the code in Test1 and Test similar if it's being called like in RunAsync?
The example is simplified, but this is an application with a high concurrency during ...
0
votes
1
answer
98
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 ...
1
vote
1
answer
68
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 ...
3
votes
3
answers
323
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 ...
2
votes
2
answers
174
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?
...
3
votes
2
answers
232
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 ...
0
votes
1
answer
148
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:
...