tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Add Go Hertz

Open WJQSERVER opened this issue 10 months ago • 6 comments

Can you add performance tests for Go hertz? It claims to have better performance than Fiber and Fasthttp. If you need a test case, I can try to PR one.

https://github.com/cloudwego/hertz

I want to know its real performance

WJQSERVER avatar Mar 12 '25 23:03 WJQSERVER

Sure, I'll do it along with Gnet sometime in the future

antonputra avatar Mar 13 '25 06:03 antonputra

Thanks for your reply. I just migrated one of my projects from fiber to hertz. In my usage scenario, it has better performance than fiber, and its http2 and http3 support is better than fasthttp. fasthttp's http2 still has problems.

WJQSERVER avatar Mar 13 '25 12:03 WJQSERVER

Hertz can utilise either the standard library net or ByteDance's self-developed netpoll. Could we incorporate both into the comparison? This would allow us to better observe the extent of scheduling and lower-level optimisations.

WJQSERVER avatar Mar 13 '25 12:03 WJQSERVER

@WJQSERVER thanks for the context i'll see what i can do

antonputra avatar Mar 13 '25 21:03 antonputra

Sure, I'll do it along with Gnet sometime in the future

According to Hertz's tests, Hertz outperforms gin, fiber and fasthttp.

We have already had these:

  • 203 - Rust (Actix) vs. Go (Golang): Performance Benchmark in Kubernetes (EKS)
  • 204 - Go (fiber) vs. Go (stdlib) vs. Go (gin): Performance Benchmark in Kubernetes
  • 205 - Rust (Actix) vs. Go (Stdlib): Performance Benchmark in Kubernetes
  • 206 - Rust (Actix) vs Rust (Axum) vs Rust (Rocket): Performance Benchmark in Kubernetes

We may add Gnet and Hertz to 204, and add a new test comparing between the top two or three frameworks written in Go or Rust.

Or shall we just add a test giving comparison between all of them at the same time? :)


Bytedance has salvo, too, which is written in Rust. I think it's a good change to add it to perf test.


Here's an example crate: https://github.com/cxw620/web-framework-bench. I'm not familiar with k8s and that's what I can help :(

cxw620 avatar Mar 22 '25 10:03 cxw620

The configs for it are many WithTransport() will select the network layer.

@WJQSERVER thanks for the context i'll see what i can do

vandergrafgenerator avatar Apr 30 '25 14:04 vandergrafgenerator