apache/thrift — pull request #122 by romange (2014-05-17 07:55:53+00:00)
Title: 0.9.x

Eliminate redundant allocations for temporary args during RPC processing.
The change is suitable for ThreadPoolServer where each thread processed its own connection.

We create thread local request/response arguments instead of allocating them on stack in TDispatchProcessor. This way, the next RPC reuses already allocated strings and arrays.
In order to make sure that the objects are semantically empty we added a new method "clear" that resets all its fields to their initial values (0 for basic types, empty for containers) and unsets optional fields.

On our system the CPU usage during high QPS period was cut by 50%.