andymccurdy/redis-py — pull request #505 by tzickel (2014-06-26 21:24:19+00:00)
Title: Added support for reusing a bytearray buffer when parsing with hiredis-py 0.1.4

This patch should make it easier on memory allocations in the recv loop (big ones or many small ones).

I've added in hiredis-py 0.1.4 support for all type buffers so we could use sock.recv_into in the recv loop. This should ease the pressure on memory allocations.

The code is ugly with usebuffer mainly because of the python 2.5 dependency (which is removed) and the 0.1.4 (which might take time to get compiled to platforms like windows).