Current HTTP/2 implementation sends WindowUpdate frame each time when data frame is processed. That leads to network saturation and oversynchronization on "Http2Connection.sendlock".
In case of getting small data (less than max frame size) we get 55% of blocks on sendWindowUpdate (and only 37% on sendHeaders).
Even in case of getting large data (1Mbytes) - 18% of all blocks is caused by sendWindowUpdate.
Suggested performance improvement provides 2x-18x performance speedup.
Implemented optimizations:
1. Accumulate size of received data and send bulk WindowUpdate when some watermark is reached.
2. Don't send stream WindowUpdate when the last data frame is received (set flag END_STREAM)
3. WindowUpdate frame goes directly to HttpConnection bypassing Http2Connection.sendlock. That is allowed with proper protection for "do not insert WindowUpdate frame between Headers and Continuation frames".
webrev: http://cr.openjdk.java.net/~skuksenko/jep110/8161004/