apache/incubator-spark — pull request #487 by njwhite (2014-01-21 11:39:26+00:00)
Title: reuse Kryo, Input & Output objects where possible

Since creating a Kryo Output involves allocating a (2MB by default) chunk of memory, we should re-use these objects whereever possible. It's easiest to stash them in a ThreadLocal, as that guarantees different threads won't trample each other's Output buffers.