Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

go-faster/hx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hx experimental

Work in progress.

Simplified and reworked fork of fasthttp.

Intended to serve plaintext HTTP 1.1 behind load balancer and reverse-proxy in controlled environment.

Fully buffers requests and responses.

Non-goals

  • Client
  • Load balancing
  • WebSocket
  • Streaming, like io.Reader or io.Writer
  • Forms
  • Files
  • HTTP 2.0, 3.0, QUIC
  • TLS
  • Running without reverse proxy
  • Optimizations for idle connections

Benchmarks

Due to different tradeoffs, direct comparison with net/http and fasthttp is invalid.

Preliminary results on Ryzen 5950x

wrk -c 200 -t 12 http://localhost:8080
Running 10s test @ http://localhost:8080
  12 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   208.27us    1.86ms  66.27ms   98.56%
    Req/Sec   135.88k     8.35k  175.85k    87.14%
  16293688 requests in 10.10s, 2.23GB read
Requests/sec: 1613299.37
Transfer/sec:    226.17MB
name          old time/op    new time/op     delta
ServeConn-32     675ns ± 2%      411ns ± 2%  -39.07%  (p=0.000 n=10+10)

name          old speed      new speed       delta
ServeConn-32  78.5MB/s ± 2%  128.9MB/s ± 2%  +64.14%  (p=0.000 n=10+10)