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

deno_core #1827

Merged
merged 5 commits into from Feb 26, 2019

Conversation

2 participants
@ry
Copy link
Collaborator

ry commented Feb 22, 2019

./target/debug/deno_core_test passes

@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 25, 2019

this branch

~/src/deno2> ./third_party/wrk/mac/wrk -c 10 -d 30 http://127.0.0.1:8080/
Running 30s test @ http://127.0.0.1:8080/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 280.41us 466.28us 27.04ms 99.84%
Req/Sec 17.71k 1.24k 19.98k 74.92%
1060524 requests in 30.10s, 51.58MB read
Requests/sec: 35232.36
Transfer/sec: 1.71MB

tools/node_tcp.js

~/src/deno2> ./third_party/wrk/mac/wrk -c 10 -d 30 http://127.0.0.1:4544/
Running 30s test @ http://127.0.0.1:4544/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 230.22us 109.64us 5.49ms 80.46%
Req/Sec 21.12k 1.60k 26.48k 84.72%
1264901 requests in 30.10s, 61.52MB read
Requests/sec: 42022.83
Transfer/sec: 2.04MB

deno tests/http_bench.js

~/src/deno2> ./third_party/wrk/mac/wrk -c 10 -d 30 http://127.0.0.1:4500/
Running 30s test @ http://127.0.0.1:4500/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.77ms 739.31us 38.75ms 97.53%
Req/Sec 2.90k 274.64 3.24k 94.33%
173396 requests in 30.00s, 8.43MB read
Requests/sec: 5779.25
Transfer/sec: 287.83KB

@ry ry force-pushed the ry:fast branch from bc8059d to c74c0ed Feb 25, 2019

@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 25, 2019

here's what strace looks like on a single request
https://gist.github.com/ry/4bcc56950b6fe2239c8d56fca5f23e38

@ry ry marked this pull request as ready for review Feb 25, 2019

@ry ry force-pushed the ry:fast branch 2 times, most recently from 351dfce to 0195760 Feb 25, 2019

@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 26, 2019

osx, current_thread runtime (855b719)

http_bench

~/src/deno2> ./third_party/wrk/mac/wrk -c 10 -d 10 http://127.0.0.1:8080/
Running 10s test @ http://127.0.0.1:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   271.37us    0.87ms  30.20ms   98.59%
    Req/Sec    23.83k     2.05k   26.65k    87.62%
  478721 requests in 10.10s, 23.28MB read
Requests/sec:  47396.75
Transfer/sec:      2.31MB

tools/node_tcp.js

~/src/deno2> ./third_party/wrk/mac/wrk -c 10 -d 10 http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   266.51us  376.93us  16.44ms   98.92%
    Req/Sec    19.30k     2.25k   26.58k    81.68%
  388001 requests in 10.10s, 18.87MB read
Requests/sec:  38416.29
Transfer/sec:      1.87MB
@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 26, 2019

linux, current_thread, f2a4784

tools/node_tcp.js

> ./third_party/wrk/linux/wrk -c 10 -d 10 -t 1 http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  1 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   146.45us  237.37us   8.44ms   98.05%
    Req/Sec    78.43k     9.08k   81.17k    97.00%
  779672 requests in 10.00s, 37.92MB read
Requests/sec:  77945.59
Transfer/sec:      3.79MB

http_bench before "Respond to many async ops at once" (855b719)

Running 10s test @ http://127.0.0.1:8080/
  1 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   232.57us  753.38us  25.71ms   97.03%
    Req/Sec    86.88k     7.31k   89.24k    97.00%
  864422 requests in 10.00s, 42.04MB read
Requests/sec:  86432.45
Transfer/sec:      4.20MB

http_bench after "Respond to many async ops at once"

> ./third_party/wrk/linux/wrk -c 10 -d 10 -t 1 http://127.0.0.1:8080/
Running 10s test @ http://127.0.0.1:8080/
  1 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   137.95us  315.44us  14.34ms   97.17%
    Req/Sec    97.03k     3.27k   98.88k    92.00%
  965107 requests in 10.00s, 46.94MB read
Requests/sec:  96480.91
Transfer/sec:      4.69MB

hyper_hello

> ./third_party/wrk/linux/wrk -c 10 -d 10 -t 1 http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  1 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    93.27us  172.14us   6.80ms   99.46%
    Req/Sec    77.42k     5.67k   81.94k    97.00%
  770246 requests in 10.00s, 64.64MB read
Requests/sec:  77018.14
Transfer/sec:      6.46MB
@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 26, 2019

Now the benchmark supports true zero-copy buffers. Here are the benchmarks:

With zero-copy buffer (7e7af40)

> ./third_party/wrk/linux/wrk -c 10 -d 30 http://127.0.0.1:8080/
Running 30s test @ http://127.0.0.1:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   101.33us  260.48us  17.13ms   99.39%
    Req/Sec    57.52k     2.96k   62.40k    96.33%
  3433410 requests in 30.01s, 166.99MB read
Requests/sec: 114423.49
Transfer/sec:      5.57MB

before zero-copy (62cd9ac)

> ./third_party/wrk/linux/wrk -c 10 -d 30 http://127.0.0.1:8080/
Running 30s test @ http://127.0.0.1:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   143.05us  370.54us  17.98ms   98.84%
    Req/Sec    46.94k     2.95k   79.12k    94.34%
  2807129 requests in 30.10s, 136.53MB read
Requests/sec:  93261.26
Transfer/sec:      4.54MB

node tools/http_tcp.js

> ./third_party/wrk/linux/wrk -c 10 -d 30 http://127.0.0.1:4544/
Running 30s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   144.88us  235.98us   9.57ms   98.89%
    Req/Sec    38.79k     2.60k   42.27k    98.17%
  2316103 requests in 30.01s, 112.65MB read
Requests/sec:  77179.39
Transfer/sec:      3.75MB

@ry ry changed the title WIP new low-level crate with focus on speed New low-level crate with focus on speed Feb 26, 2019

@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 26, 2019

@piscisaureus I think we should try to land this now. I hooked it up to benchmarks, so we can track further improvements there.

@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 26, 2019

travis results

http_benchmark testing DENO.
Listening on 127.0.0.1:4544
third_party/wrk/linux/wrk -d 10s http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   392.43us  722.82us  10.13ms   95.53%
    Req/Sec    18.95k     3.18k   24.37k    80.00%
  377425 requests in 10.01s, 18.36MB read
Requests/sec:  37702.05
Transfer/sec:      1.83MB

http_benchmark testing DENO using net/http.
third_party/wrk/linux/wrk -d 10s http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.09ms  444.95us  12.71ms   94.23%
    Req/Sec     4.72k   604.33     5.07k    93.00%
  94018 requests in 10.00s, 4.48MB read
Requests/sec:   9401.06
Transfer/sec:    459.04KB

http_benchmark testing deno_core_http_bench
http_bench.js start
listening http://127.0.0.1:4544/ rid = 3
third_party/wrk/linux/wrk -d 10s http://127.0.0.1:4544/
op err Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }
op err Os {Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   134.08us  275.00us   8.81ms   98.08%
    Req/Sec    44.67k     1.80k   48.68k    89.11%
  897300 requests in 10.10s, 43.64MB read
Requests/sec:  88843.97
Transfer/sec:      4.32MB

http_benchmark testing NODE.
port 4544
third_party/wrk/linux/wrk -d 10s http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   599.91us  539.03us  21.02ms   98.26%
    Req/Sec     8.87k     1.24k   18.40k    93.03%
  177515 requests in 10.10s, 18.96MB read
Requests/sec:  17577.00
Transfer/sec:      1.88MB

http_benchmark testing node_tcp.js
port 4544
third_party/wrk/linux/wrk -d 10s http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   252.84us  164.24us   6.10ms   97.58%
    Req/Sec    20.38k     2.35k   25.11k    78.50%
  405519 requests in 10.00s, 19.72MB read
Requests/sec:  40549.95
Transfer/sec:      1.97MB

http_benchmark testing RUST hyper.
Listening on http://127.0.0.1:4544
third_party/wrk/linux/wrk -d 10s http://127.0.0.1:4544/
Running 10s test @ http://127.0.0.1:4544/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    89.93us  111.73us   5.55ms   99.50%
    Req/Sec    51.69k     1.60k   56.53k    63.50%
  1028340 requests in 10.00s, 86.30MB read
Requests/sec: 102819.07
Transfer/sec:      8.63MB

@ry ry force-pushed the ry:fast branch from 0fece73 to c1181e2 Feb 26, 2019

@ry ry force-pushed the ry:fast branch from e37f9a7 to ceb61dd Feb 26, 2019

@ry ry changed the title New low-level crate with focus on speed deno_core Feb 26, 2019

@ry

This comment has been minimized.

Copy link
Collaborator Author

ry commented Feb 26, 2019

Latest Travis req/sec numbers for ceb61dd

 9330 deno std/http/http_bench.ts (real HTTP)
35341 deno tests/http_bench.ts  (fake HTTP)
20348 tools/node_http.js (real HTTP)
48892 tools/node_tcp.js (fake HTTP)
82076 *** this branch - deno_core multi-thread (fake HTTP)
89248 *** this branch - deno_core single-thread (fake HTTP)
98322 hyper_hello (real HTTP)

full report here https://gist.github.com/ry/3ff0fdb4c297b2ffb56f44f7fc783f77

@piscisaureus
Copy link
Collaborator

piscisaureus left a comment

not really reviewed, but tested. let's land it

@ry ry merged commit b8a537d into denoland:master Feb 26, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.