Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the cache used for opening directories in the pylibtiff source #1221

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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