تخطَّ إلى المحتوى

Benchmarks

هذا المحتوى غير متوفر بلغتك بعد.

Gin Web Framework Performance Benchmarks

Benchmarks help developers evaluate the efficiency and resource usage of HTTP router libraries in Go. This page summarizes measurements across many popular frameworks, so you can easily compare their speed and memory consumption.

Test Environment:

  • Host Platform: Travis CI (virtual Linux VM)
  • Machine Specs: Ubuntu 16.04.6 LTS x64
  • Test Date: May 04th, 2020
  • Gin Version: v1.6.3
  • Go Version: 1.14.2 (linux/amd64)
  • Benchmarks Source: Go HTTP Router Benchmark
  • Detailed Results: See the gist or Travis result

Gin uses an optimized fork of HttpRouter for high performance routing.

If you want to view more test cases, you can check all benchmarks here.


How to Read the Table

The benchmarks below show various Go frameworks running common HTTP routing tasks.
Lower numbers (time, memory, allocations) are better.
You can use these results for a direct, side-by-side comparison of Gin and alternative routers.

TestRepetitionsTime (ns/op)Bytes (B/op)Allocations (allocs/op)
BenchmarkGin_GithubStatic1562947276.700
BenchmarkAce_GithubStatic1554261275.900
BenchmarkAero_GithubStatic2477715148.500
BenchmarkBear_GithubStatic27888944351203
BenchmarkBeego_GithubStatic100000010643523
BenchmarkBone_GithubStatic9350712838288060
BenchmarkChi_GithubStatic13877438604323
BenchmarkDenco_GithubStatic3938499630.400
BenchmarkEcho_GithubStatic1207638299.100
BenchmarkGocraftWeb_GithubStatic15964957562965
BenchmarkGoji_GithubStatic636487618900
BenchmarkGojiv2_GithubStatic5502022098131210
BenchmarkGoRestful_GithubStatic10218312552425613
BenchmarkGoJsonRest_GithubStatic1000000102932911
BenchmarkGorillaMux_GithubStatic25555251909769
BenchmarkGowwwRouter_GithubStatic1553191677.100
BenchmarkHttpRouter_GithubStatic2792072443.100
BenchmarkHttpTreeMux_GithubStatic2144895355.800
BenchmarkKocha_GithubStatic2140531056.000
BenchmarkLARS_GithubStatic1362515689.000
BenchmarkMacaron_GithubStatic100000017477368
BenchmarkMartini_GithubStatic18718673267689
BenchmarkPat_GithubStatic10914311563364876
BenchmarkPossum_GithubStatic15758987704163
BenchmarkR2router_GithubStatic30462314041444
BenchmarkRivet_GithubStatic1148482610500
BenchmarkTango_GithubStatic100000011532488
BenchmarkTigerTonic_GithubStatic4929780249481
BenchmarkTraffic_GithubStatic10635111819466490
BenchmarkVulcan_GithubStatic1613271722983
BenchmarkAce_GithubParam838603214300
BenchmarkAero_GithubParam1181620010200
BenchmarkBear_GithubParam100000010124965
BenchmarkBeego_GithubParam100000011573523
BenchmarkBone_GithubParam1846536912188819
BenchmarkChi_GithubParam100000011024323
BenchmarkDenco_GithubParam34847983521281
BenchmarkEcho_GithubParam633738018900
BenchmarkGin_GithubParam913203213100
BenchmarkGocraftWeb_GithubParam100000014467129
BenchmarkGoji_GithubParam12486409773362
BenchmarkGojiv2_GithubParam3832332784140813
BenchmarkGoJsonRest_GithubParam1000000199171314
BenchmarkGoRestful_GithubParam7641416015435216
BenchmarkGorillaMux_GithubParam1500267663129610
BenchmarkGowwwRouter_GithubParam15920447514323
BenchmarkHttpRouter_GithubParam1042062811500
BenchmarkHttpTreeMux_GithubParam14037558353844
BenchmarkKocha_GithubParam22861705331285
BenchmarkLARS_GithubParam954037412900
BenchmarkMacaron_GithubParam5331542742107210
BenchmarkMartini_GithubParam1193979638115211
BenchmarkPat_GithubParam1506758858240848
BenchmarkPossum_GithubParam100000010014965
BenchmarkR2router_GithubParam16028867614325
BenchmarkRivet_GithubParam2986579409961
BenchmarkTango_GithubParam100000013563448
BenchmarkTigerTonic_GithubParam3888993429117622
BenchmarkTraffic_GithubParam1231609734281640
BenchmarkVulcan_GithubParam10000001138983
BenchmarkAce_GithubAll405432967000
BenchmarkAero_GithubAll576322064800
BenchmarkBear_GithubAll923421617986448943
BenchmarkBeego_GithubAll740724349671456609
BenchmarkBone_GithubAll42029228357201608620
BenchmarkChi_GithubAll762023833187696609
BenchmarkDenco_GithubAll183556449420224167
BenchmarkEcho_GithubAll312513847900
BenchmarkGin_GithubAll435502736400
BenchmarkGocraftWeb_GithubAll41173000621316561686
BenchmarkGoji_GithubAll327441615856112334
BenchmarkGojiv2_GithubAll14028705183527204321
BenchmarkGoJsonRest_GithubAll29764015071343712737
BenchmarkGoRestful_GithubAll41029131589101442938
BenchmarkGorillaMux_GithubAll34633849872516501994
BenchmarkGowwwRouter_GithubAll1000014302572144501
BenchmarkHttpRouter_GithubAll559382136000
BenchmarkHttpTreeMux_GithubAll1000015394465856671
BenchmarkKocha_GithubAll1000010631523304843
BenchmarkLARS_GithubAll477792508400
BenchmarkMacaron_GithubAll32663719071494091624
BenchmarkMartini_GithubAll33134447062265512325
BenchmarkPat_GithubAll2734381818148315226963
BenchmarkPossum_GithubAll1000016436784448609
BenchmarkR2router_GithubAll1000016022077328979
BenchmarkRivet_GithubAll146258245316272167
BenchmarkTango_GithubAll6255279611638261618
BenchmarkTigerTonic_GithubAll20086878741938564474
BenchmarkTraffic_GithubAll355347850882074414114
BenchmarkVulcan_GithubAll688519333319894609

Benchmark Table Notes

  • Repetitions: Total repetitions achieved in constant time. Higher numbers mean more confidence in the results.
  • Time (ns/op): Duration for one operation, measured in nanoseconds. Lower is better.
  • Bytes (B/op): Heap memory allocated per operation. Lower means better efficiency.
  • Allocations (allocs/op): Average number of memory allocations per operation. Fewer allocations are better for performance and garbage collection.

For questions or contributions, check our GitHub repository.