From b0bae2f339167a2bf0e80497619e30a9c0edc0da Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Mon, 30 Mar 2020 18:21:26 +0200
Subject: [PATCH] Add cache

---
 km3io/offline.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/km3io/offline.py b/km3io/offline.py
index c9a8d51..d3f66fb 100644
--- a/km3io/offline.py
+++ b/km3io/offline.py
@@ -7,6 +7,10 @@ from .tools import Branch, BranchMapper, cached_property, _to_num
 MAIN_TREE_NAME = "E"
 EXCLUDE_KEYS = ["AAObject", "t", "fBits", "fUniqueID"]
 
+# 110 MB based on the size of the largest basket found so far in km3net
+BASKET_CACHE_SIZE = 110 * 1024**2
+BASKET_CACHE = uproot.cache.ThreadSafeArrayCache(BASKET_CACHE_SIZE)
+
 
 def _nested_mapper(key):
     """Maps a key in the ROOT file to another key (e.g. trks.pos.x -> pos_x)"""
-- 
GitLab