PERF moved performance calculation out of inner loop
lazy loading for portfolio
less repeating in performance period updates
PERF: re-ordered if statements, made into exclusive checks
PERF: using comparison operation instead of tolerant_equals
BUG: added a reset to performance in run()