Skip to content

Commit

Permalink
Increase the cache used for opening directories in the pylibtiff source
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jun 27, 2023
1 parent 8fbeb6b commit b6eab61
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

### Improvements
- Harden reading some nc files ([#1218](../../pull/1218))
- Increase the cache used for opening directories in the pylibtiff source ([#1221](../../pull/1221))

### Bug Fixes
- Pass style to histogram endpoint as json ([#1220](../../pull/1220))

## 1.23.0

Expand Down
4 changes: 2 additions & 2 deletions large_image/cache_util/memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def __setitem__(self, key, value):
valueRepr = valueRepr[:500] + '...'
self.logError(
exc.__class__, config.getConfig('logprint').error,
'%s: Failed to save value %s (size %r) with key %s' % (
exc.__class__.__name__, valueRepr, valueSize, hashedKey))
'%s: Failed to save value (size %r) with key %s' % (
exc.__class__.__name__, valueSize, hashedKey))
except pylibmc.ServerDown:
self.logError(pylibmc.ServerDown, config.getConfig('logprint').info,
'Memcached ServerDown')
Expand Down
3 changes: 2 additions & 1 deletion sources/tiff/large_image_source_tiff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@ def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False,
def _getDirFromCache(self, dirnum, subdir=None):
if not hasattr(self, '_directoryCache'):
self._directoryCache = {}
self._directoryCacheMaxSize = max(20, self.levels * 3)
self._directoryCacheMaxSize = max(20, self.levels * (2 + (
self.metadata.get('IndexRange', {}).get('IndexC', 1))))
key = (dirnum, subdir)
result = self._directoryCache.get(key)
if result is None:
Expand Down

0 comments on commit b6eab61

Please sign in to comment.