Skip to content

Add gin framework - #1112

Merged
MDA2AV merged 3 commits into
MDA2AV:mainfrom
nigrosimone:add-gin
Aug 14, 2026
Merged

Add gin framework#1112
MDA2AV merged 3 commits into
MDA2AV:mainfrom
nigrosimone:add-gin

Conversation

@nigrosimone

@nigrosimone nigrosimone commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Gin 1.12 on Go net/http, standard mode.

  • meta.json: Go / flagship / standard, subscribed to baseline, pipelined, limited-conn, json, json-comp and upload
  • main.go: routing and path/query binding through the Gin API, c.JSON for the response, gin-contrib/gzip for json-comp

./scripts/validate.sh gin passes locally, 23 checks.

Disclaimer

I am neither the maintainer nor affiliated in any way with this framework. I did my best to implement it correctly, using Opus 5 as a guide.

@nigrosimone
nigrosimone marked this pull request as ready for review August 14, 2026 05:22
@nigrosimone

nigrosimone commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

benchmark -f gin --save

@github-actions

Copy link
Copy Markdown
Contributor

👋 Benchmark request received. A collaborator will review and approve the run.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ /benchmark --save cannot start: main has diverged and cannot be auto-merged into this branch. Please merge or rebase main manually, push, and re-run /benchmark --save.

@nigrosimone
nigrosimone force-pushed the add-gin branch 2 times, most recently from e9989d4 to 2b6c620 Compare August 14, 2026 05:28
@nigrosimone

nigrosimone commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

benchmark -f gin --save

@github-actions

Copy link
Copy Markdown
Contributor

👋 Benchmark request received. A collaborator will review and approve the run.

@nigrosimone

Copy link
Copy Markdown
Contributor Author

/benchmark -f gin --save

@github-actions

Copy link
Copy Markdown
Contributor

👋 Benchmark request received. A collaborator will review and approve the run.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: gin | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 322,375 2445.5% 84MiB ~0% ~0%
baseline 4096 531,197 3689.1% 204MiB ~0% ~0%
pipelined 512 821,255 3306.6% 100MiB ~0% ~0%
pipelined 4096 1,186,294 4554.4% 416MiB ~0% ~0%
limited-conn 512 143,129 1965.4% 62MiB ~0% ~0%
limited-conn 4096 168,690 2128.3% 65MiB ~0% ~0%
json 4096 180,804 2825.5% 157MiB ~0% ~0%
json-comp 512 168,393 5299.3% 362MiB ~0% ~0%
json-comp 4096 176,914 5492.9% 819MiB ~0% ~0%
json-comp 16384 179,097 5555.6% 2.2GiB ~0% ~0%
upload 32 2,462 2263.8% 43MiB ~0% ~0%
upload 256 2,915 4008.5% 67MiB ~0% ~0%
Full log
==============================================
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     32 (0/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.28ms   10.20ms   33.20ms   37.70ms   39.90ms

  12028 requests in 5.00s, 12028 responses
  Throughput: 2.40K req/s
  Bandwidth:  289.40KB/s
  Status codes: 2xx=12028, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12028 / 12028 responses (100.0%)
  Reconnects: 2410
  Per-template: 3010,3003,2986,3029
  Per-template-ok: 3010,3003,2986,3029
[info] CPU 2172.3% | Mem 40MiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     32 (0/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.10ms   5.56ms   32.60ms   37.20ms   39.70ms

  12195 requests in 5.00s, 12195 responses
  Throughput: 2.44K req/s
  Bandwidth:  293.42KB/s
  Status codes: 2xx=12195, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12195 / 12195 responses (100.0%)
  Reconnects: 2439
  Per-template: 3055,3050,3027,3063
  Per-template-ok: 3055,3050,3027,3063
[info] CPU 2338.3% | Mem 41MiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     32 (0/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   12.97ms   10.50ms   32.30ms   36.40ms   39.00ms

  12314 requests in 5.00s, 12314 responses
  Throughput: 2.46K req/s
  Bandwidth:  296.27KB/s
  Status codes: 2xx=12314, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12314 / 12314 responses (100.0%)
  Reconnects: 2458
  Per-template: 3080,3074,3059,3101
  Per-template-ok: 3080,3074,3059,3101
[info] CPU 2263.8% | Mem 43MiB

=== Best: 2462 req/s (CPU: 2263.8%, Mem: 43MiB) ===
[info] input BW: 19.53GB/s (avg template: 8516680 bytes)
[info] saved results/upload/32/gin.json
httparena-bench-gin
httparena-bench-gin

==============================================
=== gin / upload / 256c (tool=gcannon) ===
==============================================
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     256 (4/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   82.25ms   67.50ms   160.40ms   315.80ms   444.10ms

  14399 requests in 5.03s, 14415 responses
  Throughput: 2.87K req/s
  Bandwidth:  345.10KB/s
  Status codes: 2xx=14415, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 14415 / 14415 responses (100.0%)
  Reconnects: 2843
  Per-template: 3485,3615,3651,3664
  Per-template-ok: 3485,3615,3651,3664
[info] CPU 3930.3% | Mem 62MiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     256 (4/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   81.09ms   67.10ms   155.20ms   303.40ms   436.50ms

  14623 requests in 5.02s, 14637 responses
  Throughput: 2.91K req/s
  Bandwidth:  350.76KB/s
  Status codes: 2xx=14637, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 14637 / 14637 responses (100.0%)
  Reconnects: 2891
  Per-template: 3599,3693,3685,3660
  Per-template-ok: 3599,3693,3685,3660
[info] CPU 4008.5% | Mem 67MiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     256 (4/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   81.28ms   68.60ms   153.20ms   296.10ms   423.00ms

  14601 requests in 5.04s, 14615 responses
  Throughput: 2.90K req/s
  Bandwidth:  349.26KB/s
  Status codes: 2xx=14615, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 14615 / 14615 responses (100.0%)
  Reconnects: 2873
  Per-template: 3611,3715,3659,3630
  Per-template-ok: 3611,3715,3659,3630
[info] CPU 3900.3% | Mem 78MiB

=== Best: 2915 req/s (CPU: 4008.5%, Mem: 67MiB) ===
[info] input BW: 23.12GB/s (avg template: 8516680 bytes)
[info] saved results/upload/256/gin.json
httparena-bench-gin
httparena-bench-gin
[info] skip: gin does not subscribe to api-4
[info] skip: gin does not subscribe to api-16
[info] skip: gin does not subscribe to static
[info] skip: gin does not subscribe to static-tls
[info] skip: gin does not subscribe to async-db
[info] skip: gin does not subscribe to crud
[info] skip: gin does not subscribe to fortunes
[info] skip: gin does not subscribe to baseline-h2
[info] skip: gin does not subscribe to static-h2
[info] skip: gin does not subscribe to baseline-h2c
[info] skip: gin does not subscribe to json-h2c
[info] skip: gin does not subscribe to baseline-h3
[info] skip: gin does not subscribe to static-h3
[info] skip: gin does not subscribe to gateway-64
[info] skip: gin does not subscribe to gateway-h3
[info] skip: gin does not subscribe to production-stack
[info] skip: gin does not subscribe to unary-grpc
[info] skip: gin does not subscribe to unary-grpc-tls
[info] skip: gin does not subscribe to stream-grpc
[info] skip: gin does not subscribe to stream-grpc-tls
[info] skip: gin does not subscribe to echo-ws
[info] skip: gin does not subscribe to echo-ws-pipeline
[info] skip: gin does not subscribe to echo-ws-limited
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/results/gin.json - 12 new, 12 total
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
[info] restoring loopback MTU to 65536

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: gin | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 317,796 2397.0% 84MiB -1.4% ~0%
baseline 4096 520,987 3620.3% 205MiB -1.9% +0.5%
pipelined 512 834,021 3353.2% 96MiB +1.6% -4.0%
pipelined 4096 1,209,519 4485.3% 328MiB +2.0% -21.2%
limited-conn 512 145,860 2004.2% 60MiB +1.9% -3.2%
limited-conn 4096 166,236 2118.5% 68MiB -1.5% +4.6%
json 4096 164,735 2651.9% 156MiB -8.9% -0.6%
json-comp 512 168,676 5276.2% 365MiB +0.2% +0.8%
json-comp 4096 175,221 5515.3% 858MiB -1.0% +4.8%
json-comp 16384 182,155 5658.5% 1.9GiB +1.7% -13.6%
upload 32 2,454 2251.5% 41MiB -0.3% -4.7%
upload 256 2,890 3977.3% 65MiB -0.9% -3.0%
Full log
==============================================
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     32 (0/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.32ms   11.70ms   33.30ms   37.80ms   39.80ms

  11977 requests in 5.00s, 11977 responses
  Throughput: 2.39K req/s
  Bandwidth:  288.19KB/s
  Status codes: 2xx=11977, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 11977 / 11977 responses (100.0%)
  Reconnects: 2402
  Per-template: 2993,2984,2986,3014
  Per-template-ok: 2993,2984,2986,3014
[info] CPU 2225.9% | Mem 40MiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     32 (0/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.08ms   5.79ms   32.70ms   37.00ms   39.40ms

  12214 requests in 5.00s, 12215 responses
  Throughput: 2.44K req/s
  Bandwidth:  293.91KB/s
  Status codes: 2xx=12215, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12215 / 12215 responses (100.0%)
  Reconnects: 2445
  Per-template: 3057,3053,3033,3072
  Per-template-ok: 3057,3053,3033,3072
[info] CPU 2313.7% | Mem 40MiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     32 (0/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.00ms   11.80ms   32.30ms   36.80ms   39.60ms

  12271 requests in 5.00s, 12271 responses
  Throughput: 2.45K req/s
  Bandwidth:  295.28KB/s
  Status codes: 2xx=12271, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12271 / 12271 responses (100.0%)
  Reconnects: 2456
  Per-template: 3060,3060,3056,3095
  Per-template-ok: 3060,3060,3056,3095
[info] CPU 2251.5% | Mem 41MiB

=== Best: 2454 req/s (CPU: 2251.5%, Mem: 41MiB) ===
[info] input BW: 19.46GB/s (avg template: 8516680 bytes)
[info] saved results/upload/32/gin.json
httparena-bench-gin
httparena-bench-gin

==============================================
=== gin / upload / 256c (tool=gcannon) ===
==============================================
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     256 (4/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   82.33ms   67.60ms   161.20ms   322.20ms   483.40ms

  14462 requests in 5.02s, 14476 responses
  Throughput: 2.88K req/s
  Bandwidth:  346.87KB/s
  Status codes: 2xx=14476, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 14476 / 14476 responses (100.0%)
  Reconnects: 2849
  Per-template: 3542,3597,3670,3667
  Per-template-ok: 3542,3597,3670,3667
[info] CPU 4032.5% | Mem 72MiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     256 (4/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   81.73ms   69.80ms   153.80ms   306.80ms   427.00ms

  14490 requests in 5.02s, 14510 responses
  Throughput: 2.89K req/s
  Bandwidth:  347.69KB/s
  Status codes: 2xx=14510, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 14510 / 14510 responses (100.0%)
  Reconnects: 2862
  Per-template: 3572,3648,3662,3628
  Per-template-ok: 3572,3648,3662,3628
[info] CPU 3977.3% | Mem 65MiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     256 (4/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 4
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   81.71ms   68.20ms   154.90ms   304.40ms   414.90ms

  14522 requests in 5.03s, 14539 responses
  Throughput: 2.89K req/s
  Bandwidth:  348.25KB/s
  Status codes: 2xx=14539, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 14533 / 14539 responses (100.0%)
  Reconnects: 2877
  Per-template: 3573,3679,3650,3631
  Per-template-ok: 3573,3679,3650,3631
[info] CPU 3837.5% | Mem 80MiB

=== Best: 2890 req/s (CPU: 3977.3%, Mem: 65MiB) ===
[info] input BW: 22.92GB/s (avg template: 8516680 bytes)
[info] saved results/upload/256/gin.json
httparena-bench-gin
httparena-bench-gin
[info] skip: gin does not subscribe to api-4
[info] skip: gin does not subscribe to api-16
[info] skip: gin does not subscribe to static
[info] skip: gin does not subscribe to static-tls
[info] skip: gin does not subscribe to async-db
[info] skip: gin does not subscribe to crud
[info] skip: gin does not subscribe to fortunes
[info] skip: gin does not subscribe to baseline-h2
[info] skip: gin does not subscribe to static-h2
[info] skip: gin does not subscribe to baseline-h2c
[info] skip: gin does not subscribe to json-h2c
[info] skip: gin does not subscribe to baseline-h3
[info] skip: gin does not subscribe to static-h3
[info] skip: gin does not subscribe to gateway-64
[info] skip: gin does not subscribe to gateway-h3
[info] skip: gin does not subscribe to production-stack
[info] skip: gin does not subscribe to unary-grpc
[info] skip: gin does not subscribe to unary-grpc-tls
[info] skip: gin does not subscribe to stream-grpc
[info] skip: gin does not subscribe to stream-grpc-tls
[info] skip: gin does not subscribe to echo-ws
[info] skip: gin does not subscribe to echo-ws-pipeline
[info] skip: gin does not subscribe to echo-ws-limited
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/results/gin.json - 12 new, 12 total
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
[info] restoring loopback MTU to 65536

@MDA2AV
MDA2AV merged commit 846303f into MDA2AV:main Aug 14, 2026
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

Successfully merging this pull request may close these issues.

2 participants