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

Benchmarks are incorrect #8

Closed
trivikr opened this issue Jul 15, 2020 · 3 comments
Closed

Benchmarks are incorrect #8

trivikr opened this issue Jul 15, 2020 · 3 comments

Comments

@trivikr
Copy link

trivikr commented Jul 15, 2020

Describe the bug
The benchmarks shared in https://github.com/fastrodev/fastro#benchmarks are incorrect.
Deno http server serves around 25-40% less req/sec than that of Node.js denoland/deno#6722 (comment)

To Reproduce
Rerun benchmarks by returning date and connection headers in Deno/Fastro just like it's done in:

Expected behavior
Deno/fastro will serve around 25-40% less req/sec when compared to that of Node.js/Fastify

@trivikr trivikr mentioned this issue Jul 15, 2020
@ynwd
Copy link
Member

ynwd commented Jul 15, 2020

const body = new TextEncoder().encode("Hello World");

This line make Deno http server serves around 25-40% less req/sec than that of Node.js

Instead of using it, use code samples from the deno website

import { serve } from "https://deno.land/std@0.61.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
  req.respond({ body: "Hello World\n" });
}

@ynwd ynwd closed this as completed Jul 15, 2020
@trivikr
Copy link
Author

trivikr commented Jul 16, 2020

const body = new TextEncoder().encode("Hello World");

This line make Deno http server serves around 25-40% less req/sec than that of Node.js

This line is from code which Deno uses to benchmark itself
https://github.com/denoland/deno/blob/bced52505f32d6cca4f944bb610a8a26767908a8/std/http/http_bench.ts#L9-L17

Instead of using it, use code samples from the deno website

import { serve } from "https://deno.land/std@0.61.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
  req.respond({ body: "Hello World\n" });
}

Fastro should use benchmarking code used by Deno, and not from the code examples.

For whoever reading this, it's visible from responses on #6 and #8 that fastro maintainers are not interested in sharing the real benchmarks and want to just boast about fake benchmarks. It won't help in the long run, and gives a bad name for Deno community.

Good news is that there are some serious players among Deno web frameworks (like drash) who take the responsibility drashland/drash#322

@ynwd
Copy link
Member

ynwd commented Jul 16, 2020

@trivikr this benchmark is only to compare the speed of displaying 'hello-world'.

btw, I already update and move the benchmark to https://github.com/fastrodev/fastrodev.github.io/blob/master/benchmarks/deno_http.ts

the speed becomes a little slower.

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

No branches or pull requests

2 participants