orthecreedence/cl-async — pull request #13 by neonsquare (2012-10-05 09:44:05+00:00)
Title: Replace array copying by loop with faster REPLACE calls

AFAIK The APPEND-ARRAY call only gets used when draining HTTP client and server requests. Using REPLACE instead of looping is a bit faster in ClozureCL and A LOT faster in Lispworks (factor 10). I didn't check SBCL or other implementations so far.

This does not solve the heavy consing that occurs when appending this arrays though. Each append drops the whole old array AND the new input array. So another implementation strategy for draining would be even better: Resuse arrays and preallocation or collecting in a list. So you could either always adjust the first array (doubling its size on each reallocation) or you could just collect the buffers into a simple list and if all is done, go one time over the list, allocate a big enough result buffer and copy all over.