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
First pass at HTTP req/sec benchmark #996
Conversation
tools/node_http.js
Outdated
console.log("port", port); | ||
http | ||
.Server((req, res) => { | ||
res.writeHead(200, { "Content-Length": "12" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this line it is inferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
Nice to see this taking shape, but you need to keep deno connections open |
590f5ca
to
c012b7a
Compare
Fortunately/unfortunately I'm seeing that Deno is faster than Node now at this benchmark:
So, I will update it to do keep-alive. |
Using keep-alive (assuming it is doing the connection handling properly) I am also seeing deno faster than node:
|
On travis, I get something like this (previous benchmarks were from my mac laptop)
seems good. will land now. |
Nice to see this coming together, however some reminders: Node.js score 2x if you replace the HTTP module with a similarly simple net placeholder implementation: const net = require('net')
let k = Buffer.from("HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World!");
net.createServer(function (socket) {
socket.on('data', function(data) {
socket.write(k);
})
}).listen(3000) For me this goes from 20k to 40k. Also, remember that Deno is not really strictly single-threaded in CPU-time utilization but more of a 1.6x consumer. Normalizing the numbers with this in mind, together with the much simpler Node.js net implementaiton, Deno is not any more efficient than Node.js in fact they differ very much. |
@alexhultman yep - Deno is clearly slower. We will pick the optimization tree now. |
👍 |
Tests against node.
Ref #977
cc @alexhultman