facebook/tornado — Issue #425: Serious performance related issue with `_merge_prefix`.
Author: pyronicide
Created: 2011-12-28 20:48:28+00:00
State: open

I'm getting a large payload via. AsyncHTTPClient and have been very surprised at how slow everything's going (only about 15mb). It takes about 2 minutes for my response callback to be called.

Whipping out cProfile, it looks like almost all the time is being spent in `_merge_prefix`. Switching this back to cStringIO (commit 6ac2c58db7 for anyone interested), takes my execution time down to about 4 seconds (and there aren't any hotspots in cProfile).

I'd be happy to submit a patch to fix this. Any suggestions on the right way to do it?