Using ujson to load ticker files from disk during backtest

is over 30% faster.
This commit is contained in:
creslinux 2018-07-12 12:40:25 +00:00
parent af34540450
commit 87f7d9972f

View File

@ -164,7 +164,7 @@ def load_cached_data_for_updating(filename: str,
# read the cached file # read the cached file
if os.path.isfile(filename): if os.path.isfile(filename):
with open(filename, "rt") as file: with open(filename, "rt") as file:
data = ujson.load(file) data = json.load(file)
# remove the last item, because we are not sure if it is correct # remove the last item, because we are not sure if it is correct
# it could be fetched when the candle was incompleted # it could be fetched when the candle was incompleted
if data: if data: