Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Removing this line improves speed of backtest dramatically

Just in case anyone else runs into this issue, if you remove this line:

record(l=context.account.leverage)

The backtest speed increases four fold.