Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #392 from scikit-hep/optimize-remote-chunking
Browse files Browse the repository at this point in the history
Set chunkbytes to 1 MB and limitbytes to 100 MB, based on @chrisburr's tests.
  • Loading branch information
jpivarski authored Nov 8, 2019
2 parents 2453c81 + 098989d commit 49c85d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion uproot/source/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, path, auth=None, *args, **kwds):
self._size = None
self.auth = auth

defaults = {"chunkbytes": 32*1024, "limitbytes": 32*1024**2, "parallel": 8*multiprocessing.cpu_count() if sys.version_info[0] > 2 else 1}
defaults = {"chunkbytes": 1024**2, "limitbytes": 100*1024**2, "parallel": 8*multiprocessing.cpu_count() if sys.version_info[0] > 2 else 1}

def _open(self):
try:
Expand Down
2 changes: 1 addition & 1 deletion uproot/source/xrootd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, path, timeout=None, *args, **kwds):
self.timeout = timeout
super(XRootDSource, self).__init__(path, *args, **kwds)

defaults = {"timeout": None, "chunkbytes": 32*1024, "limitbytes": 32*1024**2, "parallel": False}
defaults = {"timeout": None, "chunkbytes": 1024**2, "limitbytes": 100*1024**2, "parallel": False}

def _open(self):
try:
Expand Down
4 changes: 2 additions & 2 deletions uproot/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ def basket_uncompressedbytes(self, i, keycache=None):
self._tryrecover()
return self._threadsafe_key(i, keycache, False)._fObjlen

def basket_compressedbytes(self, i):
def basket_compressedbytes(self, i, keycache=None):
if self._recoveredbaskets is None:
self._tryrecover()
key = self._threadsafe_key(i, keycache, False)
Expand Down Expand Up @@ -2023,7 +2023,7 @@ def daskframe(path, treepath, branches=None, namedecode="utf-8", entrysteps=floa

################################################################ for quickly getting numentries

def numentries(path, treepath, total=True, localsource=MemmapSource.defaults, xrootdsource=XRootDSource.defaults, httpsource=HTTPSource.defaults, executor=None, blocking=True, **options):
def numentries(path, treepath, total=True, localsource=MemmapSource.defaults, xrootdsource={"timeout": None, "chunkbytes": 32*1024, "limitbytes": 1024**2, "parallel": False}, httpsource={"chunkbytes": 32*1024, "limitbytes": 1024**2, "parallel": False}, executor=None, blocking=True, **options):
if isinstance(path, string_types):
paths = _filename_explode(path)
else:
Expand Down

0 comments on commit 49c85d4

Please sign in to comment.