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

error handling in minimal dispatch #3176

Merged
merged 8 commits into from Oct 24, 2019

Conversation

@bartlomieju
Copy link
Contributor

bartlomieju commented Oct 21, 2019

Towards #3117

A little prototype of error handling in minimal dispatch. I expect it to be slow but I want to start a discussion.

CC @ry

@bartlomieju bartlomieju force-pushed the bartlomieju:refactor-error_handling_in_dispatch branch from 3212df5 to ecc630e Oct 21, 2019
@ry

This comment has been minimized.

Copy link
Collaborator

ry commented Oct 22, 2019

@bartlomieju Does this have an effect on the deno_tcp http req/sec benchmark?

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

bartlomieju commented Oct 22, 2019

@ry I get around 88k req/sec instead of 95k. I need to work on it a bit more, started getting some panics locally :/

EDIT: Yikes, I put wrong numbers. Actually I'm getting around 88k req/s in deno_tcp on master branch. After fixes I get around 90k req/s with this PR. ¯_(ツ)_/¯

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

bartlomieju commented Oct 22, 2019

this PR

  "req_per_sec": {
    "deno_tcp": 50138, 
    "deno_core_single": 62672, 
    "node_proxy_tcp": 14730, 
    "deno_proxy_tcp": 14773, 
    "deno_core_multi": 61024, 
    "deno_tcp_current_thread": 47704, 
    "hyper": 54209, 
    "node_tcp": 33282, 
    "deno_http": 13311, 
    "node_http": 17620, 
    "deno_proxy": 1014, 
    "node_proxy": 2683
  }, 
  "max_latency": {
    "deno_tcp": 8.26, 
    "deno_core_single": 1.31, 
    "node_proxy_tcp": 3.06, 
    "deno_proxy_tcp": 3.82, 
    "deno_core_multi": 5.49, 
    "deno_tcp_current_thread": 1.96, 
    "hyper": 3.36, 
    "node_tcp": 2.72, 
    "deno_http": 31.25, 
    "node_http": 4.82, 
    "deno_proxy": 18.39, 
    "node_proxy": 9.86
  },

master

  "req_per_sec": {
    "deno_tcp": 55549, 
    "deno_core_single": 59915, 
    "node_proxy_tcp": 15679, 
    "deno_proxy_tcp": 18249, 
    "deno_core_multi": 62742, 
    "deno_tcp_current_thread": 55106, 
    "hyper": 54423, 
    "node_tcp": 35625, 
    "deno_http": 13972, 
    "node_http": 17561, 
    "deno_proxy": 1096, 
    "node_proxy": 2846
  }, 
  "max_latency": {
    "deno_tcp": 5.32, 
    "deno_core_single": 1.16, 
    "node_proxy_tcp": 2.06, 
    "deno_proxy_tcp": 3.29, 
    "deno_core_multi": 6.15, 
    "deno_tcp_current_thread": 2.04, 
    "hyper": 2.66, 
    "node_tcp": 3.26, 
    "deno_http": 38.37, 
    "node_http": 3.76, 
    "deno_proxy": 16.86, 
    "node_proxy": 9.06
  },
@bartlomieju bartlomieju reopened this Oct 24, 2019
@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

bartlomieju commented Oct 24, 2019

@ry, how about we land this PR so we can remove panics for malformed control buffers and work on any potential perf problems down the road?

result: buf32[2]
arg,
result,
err
};
}

This comment has been minimized.

Copy link
@ry

ry Oct 24, 2019

Collaborator

This code is very much in the hot path for our most important benchmark. I'm all for landing this to see what happens, but I will revert if it causes a noticeable slow down.

This comment has been minimized.

Copy link
@bartlomieju

bartlomieju Oct 24, 2019

Author Contributor

Yes I agree completely. I will try to optimize it further, but we can't leave out proper error handling (which is long overdue anyway)

@ry

This comment has been minimized.

Copy link
Collaborator

ry commented Oct 24, 2019

@bartlomieju Sounds good - please add a unit test for the method I pointed out and I'll land it.

cli/js/dispatch_minimal.ts Outdated Show resolved Hide resolved
@bartlomieju bartlomieju force-pushed the bartlomieju:refactor-error_handling_in_dispatch branch from 977ac04 to f5e1fee Oct 24, 2019
@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

bartlomieju commented Oct 24, 2019

@ry it looks like sccache is acting up on Windows. Did you have any problems like that recently?

EDIT: Probable cause described by @chrmoritz in #3194 (comment)

ry and others added 3 commits Oct 24, 2019
…ling_in_dispatch
@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

bartlomieju commented Oct 24, 2019

@ry ready

error_message: "Error".to_string().as_bytes().to_owned(),
};
let buf: Buf = err_record.into();
assert_eq!(buf, expected.into_boxed_slice());

This comment has been minimized.

Copy link
@ry

ry Oct 24, 2019

Collaborator

👍

@ry
ry approved these changes Oct 24, 2019
Copy link
Collaborator

ry left a comment

LGTM

@ry ry merged commit 492b87d into denoland:master Oct 24, 2019
10 checks passed
10 checks passed
test macOS-10.14
Details
test_std macOS-10.14
Details
test windows-2016
Details
test_std windows-2016
Details
test ubuntu-16.04
Details
test_debug ubuntu-16.04
Details
test_std ubuntu-16.04
Details
bench ubuntu-16.04
Details
lint ubuntu-16.04
Details
license/cla Contributor License Agreement is signed.
Details
@kevinkassimo

This comment has been minimized.

Copy link
Contributor

kevinkassimo commented Oct 28, 2019

The slowdown from this PR seems quite apparent from benchmark:

Screenshot of Deno

@bartlomieju bartlomieju deleted the bartlomieju:refactor-error_handling_in_dispatch branch Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.