Discussion:
[KPhotoAlbum] Cache size
Robert Krawitz
2016-01-24 04:31:39 UTC
Permalink
I submitted this a while back to correctly compute the cache size when
it's more than 2 GB. For that matter, the upper limit should be
raised, probably to at least 16 GB.

--------------------------- Viewer/ImageDisplay.cpp ---------------------------
index 5247f72..44680f5 100644
@@ -567,7 +567,7 @@ void Viewer::ImageDisplay::setImageList( const DB::FileNameList& list )

void Viewer::ImageDisplay::updatePreload()
{
- const int cacheSize = ( Settings::SettingsData::instance()->viewerCacheSize() * 1024 * 1024 ) / (width()*height()*4);
+ const int cacheSize = (int) ((long long) ( Settings::SettingsData::instance()->viewerCacheSize() * 1024LL * 1024LL ) / (width()*height()*4));
bool cacheFull = (m_cache.count() > cacheSize);

int incr = ( m_forward ? 1 : -1 );
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Johannes Zarl-Zierl
2016-01-24 14:47:59 UTC
Permalink
Hi Robert,
Post by Robert Krawitz
I submitted this a while back to correctly compute the cache size when
it's more than 2 GB.
Sorry, that patch must have slipped by. I've pushed it to git master.
Post by Robert Krawitz
For that matter, the upper limit should be
raised, probably to at least 16 GB.
You have me curious: How many images do you want to have pre-cached?

I'm just asking because the current limit of 4GB allows for 121 images on a 4K
display (4096 x 2160).
Do you actually go faster through your images than they can be loaded, or is
there another reason?

Cheers,
Johannes
Robert Krawitz
2016-01-24 16:06:15 UTC
Permalink
Post by Johannes Zarl-Zierl
Hi Robert,
Post by Robert Krawitz
I submitted this a while back to correctly compute the cache size when
it's more than 2 GB.
Sorry, that patch must have slipped by. I've pushed it to git master.
Post by Robert Krawitz
For that matter, the upper limit should be
raised, probably to at least 16 GB.
You have me curious: How many images do you want to have pre-cached?
I'm just asking because the current limit of 4GB allows for 121 images on a 4K display (4096 x 2160).
Do you actually go faster through your images than they can be loaded, or is there another reason?
I sometimes run through them rather quickly, stop briefly, and then
keep going, and after not very long start hitting delays. Increasing
the cache size from 2GB to 4GB appears to help.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Johannes Zarl-Zierl
2016-01-24 19:21:24 UTC
Permalink
On Sunday 24 January 2016 11:06:15 Robert Krawitz wrote:
You have me curious: How many images do you want to have pre-cached?
Post by Robert Krawitz
Post by Johannes Zarl-Zierl
I'm just asking because the current limit of 4GB allows for 121 images on
a 4K display (4096 x 2160). Do you actually go faster through your images
than they can be loaded, or is there another reason?
I sometimes run through them rather quickly, stop briefly, and then
keep going, and after not very long start hitting delays. Increasing
the cache size from 2GB to 4GB appears to help.
Ok. Thanks for the info. Btw. I have increased the upper limit to 16GB now...
Loading...