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

Use criterion's async bencher #385

Merged
merged 2 commits into from
Jun 16, 2021
Merged

Conversation

popzxc
Copy link
Contributor

@popzxc popzxc commented Jun 16, 2021

Doesn't change much in terms of both diff and bench results, but IMHO makes the code a bit more clear (by removing the necessity of block_on in every single bench).

Note that we still need to pre-create runtime and manually pass it everywhere, since we need the server to be spawned outside of the bench and run in the same runtime.

Also, I rewrote run_concurrent_round_trip in a functional style to avoid allocating Vec inside of the bench body.

rt.block_on(task).unwrap();
}
})
join_all(tasks).await;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@maciejhirsz maciejhirsz merged commit 82b1614 into paritytech:master Jun 16, 2021
@popzxc popzxc deleted the async-bencher branch June 16, 2021 11:29
dvdplm added a commit that referenced this pull request Jul 6, 2021
* master: (21 commits)
  New proc macro (#387)
  Streaming RpcParams parsing (#401)
  Set allowed Host header values (#399)
  Synchronization-less async connections in ws-server (#388)
  [ws server]: terminate already established connection(s) when the server is stopped (#396)
  feat: customizable JSON-RPC error codes via new enum variant on `CallErrror` (#394)
  [ci]: test each individual crate's manifest (#392)
  Add a way to stop servers (#386)
  [jsonrpsee types]: unify a couple of types + more tests (#389)
  Update roadmap link in readme (#390)
  Cross-origin protection (#375)
  Method aliases + RpcModule: Clone (#383)
  Use criterion's async bencher (#385)
  Async/subscription benches (#372)
  send text (#374)
  Fix link to ws server in README.md (#373)
  Concat -> simple push (#370)
  Add missing `rt` feature (#369)
  Release prep for v0.2 (#368)
  chore(scripts): publish script (#354)
  ...
niklasad1 pushed a commit that referenced this pull request Oct 15, 2021
* Use criterion's async bencher

* Rewrite concurrent roundtrip in functional style
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

Successfully merging this pull request may close these issues.

3 participants