Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive performance reduce rapidly while concurrent stream number grows #148

Open
dqzjh0319 opened this issue Mar 31, 2023 · 1 comment
Open

Comments

@dqzjh0319
Copy link

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
@tsloughter
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants