Skip to content

Adds http server API #1147

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

Closed
wants to merge 3 commits into from
Closed

Adds http server API #1147

wants to merge 3 commits into from

Conversation

ry
Copy link
Member

@ry ry commented Nov 3, 2018

Fixes #726

@ry ry force-pushed the http_server4 branch 2 times, most recently from 7edc422 to ce1ccac Compare November 3, 2018 08:45
@hayd
Copy link
Contributor

hayd commented Nov 3, 2018

I think http needs to be added to Cargo.toml to appease cargo check (?).

@ry ry force-pushed the http_server4 branch 3 times, most recently from 6fff10c to bdcf9e6 Compare November 3, 2018 09:44
Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

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

Some thoughts...

Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

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

LGTM... exciting!

@ry
Copy link
Member Author

ry commented Nov 9, 2018

Benchmarks on this hyper integration were not encouraging. Due to the large number of channels used to invert control from hyper, the system spends a lot of time in pthread_cond_wait. I am exploring a different strategy now for the HTTP server - do the parsing in JS and distribute it as an external module. WIP is at https://github.com/denoland/net/blob/master/http.ts

@ry ry closed this Nov 9, 2018
@ghost
Copy link

ghost commented Nov 10, 2018

I don't know what you're up to but an ideal solution is going to be just doing as much of it in native code[1] (Rust, C, whatever). I've said this about a million times by now.

Otherwise you pretty much just end up with a copy of Node.js where things that should have been native code just end up as JS wrappers of JS wrappers of JS wrappers wrapping away the majority of all peformance. I don't know what pthread_cond_wait has to do with anything of this - it shouldn't be part of your code flow. I don't know why that's even called. It shouldn't.

Feels like you want to agree with everyone yet you don't really listen and follow through with what was talked about. If you don't agree just say, "I don't agree I'm not going to listen to your input", instead of letting people think you listened.

[1]:
I have a proof of concept here: https://github.com/uNetworking/uWebSockets.js it does like 3-4 times that of Hyper, from within JS.

@hayd
Copy link
Contributor

hayd commented Nov 10, 2018

@ry could it be related to rust-lang/futures-rs#1170 (comment) ? Perhaps that suggestion helps your benchmark (reduces the time in pthread_cond_wait).

@alexhultman It's great to see alternative options, the good thing is deno doesn't have to be wedded to an implementation yet.
Consider adding uws to https://www.techempower.com/benchmarks !

@ghost
Copy link

ghost commented Nov 10, 2018

You're missing the point, it's not regarding <insert any implementation>, it's about how you bind that implementation to JavaScript efficiently. You can swap implementation all you want, it's not going to make any difference unless you nail down a good performing binding.

@ghost
Copy link

ghost commented Nov 10, 2018

I've said that about a billion times before: #205 (comment)

People just think making something efficient is taking a brand name with a nice logo and like attaching that brand name to something else and boom now you have something efficient no matter what you did to that brand name.

People essentially think deno is going to be Hyper for Rust because it wraps it. Guess what it's not even close. That Hyper perf. is completely lost due to inefficient V8 bindings. I said that 4 months ago and here we are today. I had proof of concept code back then, I have it today. People argue that Tokio can do 2 million req/sec yet deno caps out at 20k. ...and the conclusion is: "we can swap out Tokio for something we wrote in TypeScript". It's delusion.

Look in that issue report from June - people are completely obsessed with "Rust = performance" and assume that just because you pick that brand name you're done.

Guess what? If you're making a JavaScript runtime, then the JavaScript is always going to be your bottleneck. It doesn't matter one bit what kind of "high performance" Rust server you pick unless you cannot solve the binding efficiently.

Deno currently does that worse than Node.js - things are moving in the wrong way. And now there's talk about reimplementing everything in TypeScript. Why would you rewrite Http servers in TypeScript when there already are finished Rust servers? If it sucks in performance now, it's going to suck even more when rewritten in TypeScript.

@ry ry mentioned this pull request Jan 25, 2019
@rsp rsp mentioned this pull request Apr 16, 2019
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.

4 participants