mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-12 12:12:04 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user