Receive performance reduce rapidly while concurrent stream number grows
dqzjh0319 opened this issue · comments
In our test, performance reduces rapidly when concurrent stream number grows.
We found the follow code block in "h2_stream_set.erl",
get_from_subset(Id, PeerSubset) ->
case lists:keyfind(Id, 2, PeerSubset#peer_subset.active) of
false ->
#closed_stream{id=Id};
Stream ->
Stream
end.
{StreamID, ClientPid} is stored in list struct, it can somehow explain the performance issue we met.
Our use case is gRPC unary.
I have not checked the overall usage of this data structure yet. My suggestion is general to the kind of problem,
- Keep list data structure, use qsort like way to speed lookup
- Replace it with map or even ets table
Thanks, yea, replacing with a map or ets table has been the plan. I've just never gotten around to my plans :( #144
There has been renewed usage of this library and I've hoped that the lack of development will change in the future.