ipython/ipython — pull request #5535 by minrk (2014-04-06 01:15:30+00:00)
Title: fix n^2 performance issue in coalesce_streams preprocessor

for n consecutive stream outputs, `\r` fix would be compiled n times, and applied to each output (n-i) times.

- move pattern to module level
- apply replacement after coalescing outputs

An example notebook on nbviewer with ~1k outputs that was taking 90 seconds to render now takes 3 seconds.