Increased the step to around 10MB

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-11-06 11:08:18 +02:00
parent cc291219f9
commit 670e91cb60
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -102,7 +102,7 @@ class PixmapCache final : public QObject {
bool _markCacheMissByEviciton() bool _markCacheMissByEviciton()
{ {
static constexpr int maxInt = std::numeric_limits<int>::max(); static constexpr int maxInt = std::numeric_limits<int>::max();
static constexpr uint oneMB = 1000; static constexpr uint step = 10240;
static constexpr int oneSecond = 1000; static constexpr int oneSecond = 1000;
auto now = QTime::currentTime(); auto now = QTime::currentTime();
@ -117,7 +117,7 @@ class PixmapCache final : public QObject {
m_last_cache_miss_by_eviciton = now; m_last_cache_miss_by_eviciton = now;
if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) {
// increase the cache size // increase the cache size
uint newSize = _cacheLimit() + oneMB; uint newSize = _cacheLimit() + step;
if (newSize >= maxInt) { // increase it until you overflow :D if (newSize >= maxInt) { // increase it until you overflow :D
newSize = maxInt; newSize = maxInt;
qDebug() << m_consecutive_fast_evicitons qDebug() << m_consecutive_fast_evicitons