kazuho/h2o — pull request #19 by kazuho (2014-09-24 05:35:14+00:00)
Title: [http2] optimize memory locality

Current implementation works as follows:

1. parses all incoming frames (while starting to process the requests if the number of requests being processed is below `http2_max_concurrent_streams_per_connection`)
2. send the output and close the streams that have been sent (and start processing new requests up to the described limit)

The problem is that in this scenario, streams are allocated to up to `SETTINGS_MAX_CONCURRENT_STREAMS` even if they are retired immediately in 2 (in case of small files).

This pull request tackles the problem by stopping the processing of incoming data when the number of processing requests hit the limit. It then sends the data, reads the buffered input, ... and so on.

However the results of the benchmark is mixed. There is a 20% increase in qps (170k -> 210k) for 6-byte files. OTOH we see 5% decrease for 4k files.