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

Optimize http_bench_json_ops example #16505

Merged
merged 26 commits into from
Jan 18, 2023

Conversation

littledivy
Copy link
Member

No description provided.

@ry
Copy link
Member

ry commented Nov 1, 2022

Let’s publish polloi as a crate?

@littledivy
Copy link
Member Author

littledivy commented Nov 1, 2022

Maybe when we use it somewhere apart from the example? It's just more code to compile if we add it to the workspace

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

It seems odd to have this one benchmark use polloi while the rest of the system uses tokio...

@piscisaureus
Copy link
Member

I don't think it is working. The last benchmark run on CI run gets 1 request per second.

http_benchmark testing CORE http_bench_json_ops
/home/runner/work/deno/deno/target/release/examples/http_bench_json_ops
http_bench_ops listening on http:https://127.0.0.1:4570/
/home/runner/work/deno/deno/third_party/prebuilt/linux64/wrk -d 10s --latency http:https://127.0.0.1:4570/
Running 10s test @ http:https://127.0.0.1:4570/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   435.40us  213.60us 767.00us   60.00%
    Req/Sec    50.00      0.00    50.00    100.00%
  Latency Distribution
     50%  507.00us
     75%  549.00us
     90%  767.00us
     99%  767.00us
  10 requests in 10.02s, 510.00B read
Requests/sec:      1.00
Transfer/sec:      50.89B

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@littledivy littledivy enabled auto-merge (squash) January 15, 2023 10:11
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Because this is an old PR I want to review again in detail if you want to land.

Copy link
Member Author

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

@ry PTAL

@littledivy littledivy requested a review from ry January 16, 2023 13:38
core/Cargo.toml Outdated Show resolved Hide resolved
core/examples/http_bench_json_ops/http_bench_json_ops.js Outdated Show resolved Hide resolved
Comment on lines -78 to -81
// When a `TcpStream` resource is closed, all pending 'read' ops are
// canceled, while 'write' ops are allowed to complete. Therefore only
// 'read' futures are attached to this cancel handle.
cancel: CancelHandle,
Copy link
Member

Choose a reason for hiding this comment

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

Why is this removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because cancellation is not used in the benchmark.

Comment on lines -103 to -105
fn close(self: Rc<Self>) {
self.cancel.cancel()
}
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@littledivy littledivy enabled auto-merge (squash) January 18, 2023 14:54
@littledivy littledivy merged commit f418be4 into denoland:main Jan 18, 2023
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.

None yet

4 participants