• Tatsuhiro Tsujikawa's avatar
    Optimize connection level remote flow control · a11fbf6e
    Tatsuhiro Tsujikawa authored
    Previously when connection level remote flow control window gets 0, we
    mark the stream having DATA frame with
    NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL.  When connection level
    WINDOW_UPDATE is received, we checks all existing streams, including
    closed ones, and call nghttp2_stream_resume_deferred_data().  The
    profiler shows this is expensive.
    
    Now we prepare dedicated priority queue for DATA frames.  And we don't
    mark stream with NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL when DATA
    cannot be sent solely due to connection level flow control.  Instead,
    we just queue DATA item to queue.  We won't pop DATA item from queue
    when connection level remote window size is 0.  This way, we avoid the
    expensive operation for all streams when WINDOW_UPDATE is arrived.
    a11fbf6e
nghttp2_session.c 178 KB