quantopian/zipline — pull request #413 by ssanderson (2014-10-17 02:55:53+00:00)
Title: PERF: Optimized rewrite of HistoryContainer.update.

Uses a numpy array instead of a dict of dicts when initializing history
container.

In testing this reduced the total time spent in HistoryContainer.update
by 66%.

BEFORE COMMIT:
Thu Oct 16 22:30:46 2014 results/cprofile/unoptimized

185223320 function calls (182210491 primitive calls) in 401.351
seconds

Ordered by: cumulative time
List reduced from 2398 to 27 due to restriction <'update'>

ncalls tottime percall cumtime percall filename:lineno(function)
8580 0.461 0.000 160.571 0.019
qexec/zipline/history/history_container.py:388(update)

AFTER COMMIT:
Thu Oct 16 22:12:28 2014 results/cprofile/optimized

143177181 function calls (140164352 primitive calls) in 272.403
seconds

Ordered by: cumulative time
List reduced from 2395 to 27 due to restriction <'update'>

ncalls tottime percall cumtime percall filename:lineno(function)
8580 0.086 0.000 47.294 0.006 qexec/zipline/history/history_container.py:388(update)