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

benchmark #2

Open
OnurGvnc opened this issue Sep 14, 2022 · 4 comments
Open

benchmark #2

OnurGvnc opened this issue Sep 14, 2022 · 4 comments

Comments

@OnurGvnc
Copy link
Contributor

Hi, How do you compare performance with other node.js frameworks?
Which tool or command do you use for benchmarking?

I did something like https://github.com/OnurGvnc/hono-node-server/tree/dev/benchmarks

{ connections: 50, duration: 10 }

fastify           105,594 req/seq
hono               50,012 req/seq
express            24,613 req/seq
hono (undici)      17,648 req/seq

with MacBookAir10,1 M1 16GB RAM 8 Core

@yusukebe
Copy link
Member

First, I've removed the example directory 6c0dade. I think it's better to put the examples in other places such https://github.com/honojs/examples

About benchmarks. I recommend using Oha or bombardier than autocannon because they are faster than that.

I think we need to try several other methods instead of just benchmarking "Hello World". For example, parsing URL query and path parameters, rendering JSON or parsing request body. The following projects are for reference.

SaltyAom/bun-http-framework-benchmark: Compare throughput benchmark from various Bun HTTP framework

By the way, it is better to put the benchmark directory in this project.

@that-ambuj
Copy link
Contributor

that-ambuj commented Nov 21, 2022

Hey there, so lately I've been benchmarking my Rust programs against equivalent node js programs. To do multiple benchmarks with multiple runs, I've been using https://github.com/sharkdp/hyperfine , It has everything for benchmarks and it is both beautiful and fast. I think it would be great if we use this in a script along with oha. It can also export to markdown and has a wide range of options for fine tuning the benchmarks.

@yusukebe
Copy link
Member

Hi @that-ambuj

It looks good! I've already stared that repository but, I did not try yet:)

@that-ambuj
Copy link
Contributor

I'll try and make benchmark scripts when I have free time.

tangye1234 pushed a commit to tangye1234/honojs-node-server that referenced this issue Nov 21, 2023
perf: Response via cache also for a readable steam or a promise.
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

3 participants