fsharp/fsharpx — pull request #267 by eulerfx (2013-10-23 20:42:33+00:00)
Title: make BatchProcessingAgent more efficient

...and fix Observable.bufferWithTimeOrCount to call it properly. Formerly, the BatchProcessingAgent would use an F# list to store buffered messages. When the batch size is sufficiently large, list reversal and subsequent array creation can be inefficient. The new implementation uses an ArraySegment instead. Also, Observable.bufferWithTimeOrCount would incorrectly initialize the agent switching the batch size with the timeout - this was also fixed.