ENH: Switching from cachetools.LRUCache to lru-dict's LRU cache.

lru-dict is written in C and seems much more performant.
This commit is contained in:
Jean Bredeche
2016-09-16 11:03:13 -04:00
parent 86c7635b45
commit eb7e1fa580
6 changed files with 19 additions and 18 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ from abc import (
abstractmethod,
abstractproperty,
)
from lru import LRU
from cachetools import LRUCache
from numpy import around, hstack
from pandas import Int64Index
@@ -89,7 +89,7 @@ class HistoryLoader(with_metaclass(ABCMeta)):
self._reader = reader
self._adjustments_reader = adjustment_reader
self._window_blocks = {
field: ExpiringCache(LRUCache(maxsize=sid_cache_size))
field: ExpiringCache(LRU(sid_cache_size))
for field in self.FIELDS
}
+2 -2
View File
@@ -16,7 +16,7 @@ import os
from os.path import join
from textwrap import dedent
from cachetools import LRUCache
from lru import LRU
import bcolz
from bcolz import ctable
from intervaltree import IntervalTree
@@ -788,7 +788,7 @@ class BcolzMinuteBarReader(MinuteBarReader):
self._minutes_per_day = metadata.minutes_per_day
self._carrays = {
field: LRUCache(maxsize=sid_cache_size)
field: LRU(sid_cache_size)
for field in self.FIELDS
}