PERF: Remove deepcopy from EventWindow ticks.

The deepcopy of events into the EventWindow's ticks was causing
a significant increase in memory consumption, e.g. an algorithm with
almost 200 sids and 14 vwaps removing the deepcopy reduces the amount
of memory consumed by about 40%.

The downside is that if an event's properties are changed, which is
not advised, later on, then the signal derived from vwap etc.
may be changed.
This commit is contained in:
Eddie Hebert
2013-07-31 18:55:07 -04:00
parent 7139ac7061
commit 376ae33264
+1 -2
View File
@@ -23,7 +23,6 @@ import logbook
from numbers import Integral
from copy import deepcopy
from datetime import datetime
from collections import deque
from abc import ABCMeta, abstractmethod
@@ -216,7 +215,7 @@ class EventWindow(object):
self.assert_well_formed(event)
# Add new event and increment totals.
self.ticks.append(deepcopy(event))
self.ticks.append(event)
# Subclasses should override handle_add to define behavior for
# adding new ticks.