performance overhead when allocating many small buffers with the pool

Manlio Perillo manlio_perillo at
Sun Oct 14 22:33:44 MSD 2007


In my mod_wsgi implementation (function wsgi_build_environment) I need 
to copy each of the HTTP header and wsgi params in Python objects.

In the current implementation I just allocate a buffer, copy the content 
in it, and then create a Python String object.

I'm assuming that using an allocator pool, allocating small buffers is 
cheap, but I would like a confirmation.

An alternative implementation is to allocate only one buffer, using the 
max lenght required, and reusing it for every Python object.

Thanks  Manlio Perillo

More information about the nginx mailing list