julienschmidt / go-http-routing-benchmark

Go HTTP request router and web framework benchmark
BSD 3-Clause "New" or "Revised" License
1.65k stars 237 forks source link

Next round of the benchmark #4

Open astaxie opened 10 years ago

astaxie commented 10 years ago

hi, @julienschmidt

I have test you code in my local. the bench is much better.

  1. your code is the old version. so I change the code in my local.
  2. I test local in my develop branch. maybe the performence is much better.

later I will send you a pull request. thanks!

and the follow is the result:

go test -bench=.

#GithubAPI Routes: 203
   Beego: 179192 Bytes
   Denco: 113976 Bytes
   GocraftWeb: 97832 Bytes
   Goji: 50920 Bytes
   GoJsonRest: 142512 Bytes
   GorillaMux: 724552 Bytes
   HttpRouter: 44200 Bytes
   HttpTreeMux: 81632 Bytes
   Kocha: 790944 Bytes
   Martini: 547632 Bytes
   Pat: 16808 Bytes
   TigerTonic: 97880 Bytes
   Traffic: 496760 Bytes

#GPlusAPI Routes: 13
   Beego: 9584 Bytes
   Denco: 47744 Bytes
   GocraftWeb: 12088 Bytes
   Goji: 3456 Bytes
   GoJsonRest: 11608 Bytes
   GorillaMux: 34224 Bytes
   HttpRouter: 3128 Bytes
   HttpTreeMux: 7160 Bytes
   Kocha: 129424 Bytes
   Martini: 27408 Bytes
   Pat: 1448 Bytes
   TigerTonic: 9496 Bytes
   Traffic: 23456 Bytes

#ParseAPI Routes: 26
   Beego: 20264 Bytes
   Denco: 48296 Bytes
   GocraftWeb: 12288 Bytes
   Goji: 5872 Bytes
   GoJsonRest: 14816 Bytes
   GorillaMux: 60096 Bytes
   HttpRouter: 5768 Bytes
   HttpTreeMux: 7760 Bytes
   Kocha: 184480 Bytes
   Martini: 48584 Bytes
   Pat: 1976 Bytes
   TigerTonic: 10520 Bytes
   Traffic: 45672 Bytes

#Static Routes: 157
   HttpServeMux: 18272 Bytes
   Beego: 104696 Bytes
   Denco: 58504 Bytes
   GocraftWeb: 60024 Bytes
   Goji: 35008 Bytes
   GoJsonRest: 145816 Bytes
   GorillaMux: 327624 Bytes
   HttpRouter: 24632 Bytes
   HttpTreeMux: 78696 Bytes
   Kocha: 117920 Bytes
   Martini: 317312 Bytes
   Pat: 16712 Bytes
   TigerTonic: 87880 Bytes
   Traffic: 297736 Bytes

testing: warning: no tests to run
PASS
BenchmarkBeego_Param      500000          4086 ns/op        1181 B/op         17 allocs/op
BenchmarkDenco_Param     5000000           537 ns/op          50 B/op          2 allocs/op
BenchmarkGocraftWeb_Param    1000000          2136 ns/op         674 B/op          9 allocs/op
BenchmarkGoji_Param  1000000          1115 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_Param     200000          7692 ns/op        1803 B/op         30 allocs/op
BenchmarkGorillaMux_Param     500000          5742 ns/op         786 B/op          7 allocs/op
BenchmarkHttpRouter_Param   10000000           203 ns/op          33 B/op          1 allocs/op
BenchmarkHttpTreeMux_Param   2000000           763 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_Param     5000000           502 ns/op          58 B/op          3 allocs/op
BenchmarkMartini_Param    200000          7908 ns/op        1187 B/op         13 allocs/op
BenchmarkPat_Param   1000000          2284 ns/op         687 B/op         14 allocs/op
BenchmarkTigerTonic_Param     500000          3875 ns/op        1027 B/op         19 allocs/op
BenchmarkTraffic_Param    200000          7215 ns/op        2030 B/op         23 allocs/op

BenchmarkBeego_Param5     200000          8548 ns/op        1606 B/op         22 allocs/op
BenchmarkDenco_Param5    1000000          1624 ns/op         409 B/op          5 allocs/op
BenchmarkGocraftWeb_Param5    500000          3234 ns/op         948 B/op         12 allocs/op
BenchmarkGoji_Param5     1000000          1470 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_Param5    200000         13307 ns/op        3289 B/op         41 allocs/op
BenchmarkGorillaMux_Param5    200000         10386 ns/op         916 B/op          7 allocs/op
BenchmarkHttpRouter_Param5   5000000           448 ns/op         163 B/op          1 allocs/op
BenchmarkHttpTreeMux_Param5  1000000          1192 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_Param5    1000000          1922 ns/op         449 B/op         10 allocs/op
BenchmarkMartini_Param5   100000         16086 ns/op        1317 B/op         13 allocs/op
BenchmarkPat_Param5   500000          4992 ns/op        1494 B/op         25 allocs/op
BenchmarkTigerTonic_Param5    200000         13274 ns/op        2640 B/op         53 allocs/op
BenchmarkTraffic_Param5   200000         11942 ns/op        2357 B/op         31 allocs/op

BenchmarkBeego_Param20    200000         11251 ns/op        2649 B/op         24 allocs/op
BenchmarkDenco_Param20    500000          4262 ns/op        1679 B/op          7 allocs/op
BenchmarkGocraftWeb_Param20   200000         10206 ns/op        3864 B/op         17 allocs/op
BenchmarkGoji_Param20     500000          4280 ns/op        1261 B/op          2 allocs/op
BenchmarkGoJsonRest_Param20    50000         32105 ns/op       10666 B/op         77 allocs/op
BenchmarkGorillaMux_Param20   100000         19796 ns/op        3312 B/op         10 allocs/op
BenchmarkHttpRouter_Param20  1000000          1297 ns/op         653 B/op          1 allocs/op
BenchmarkHttpTreeMux_Param20      500000          6761 ns/op        2219 B/op          4 allocs/op
BenchmarkKocha_Param20    500000          5925 ns/op        1839 B/op         27 allocs/op
BenchmarkMartini_Param20       50000         70254 ns/op        3714 B/op         16 allocs/op
BenchmarkPat_Param20      500000          5002 ns/op        1494 B/op         25 allocs/op
BenchmarkTigerTonic_Param20    50000         52744 ns/op       11270 B/op        179 allocs/op
BenchmarkTraffic_Param20       50000         35244 ns/op        8251 B/op         68 allocs/op

BenchmarkBeego_ParamWrite     500000          5232 ns/op        1622 B/op         22 allocs/op
BenchmarkDenco_ParamWrite    5000000           545 ns/op          50 B/op          2 allocs/op
BenchmarkGocraftWeb_ParamWrite   1000000          2189 ns/op         683 B/op         10 allocs/op
BenchmarkGoji_ParamWrite     1000000          1171 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_ParamWrite    200000          9266 ns/op        2284 B/op         35 allocs/op
BenchmarkGorillaMux_ParamWrite    500000          6357 ns/op         786 B/op          7 allocs/op
BenchmarkHttpRouter_ParamWrite  10000000           267 ns/op          33 B/op          1 allocs/op
BenchmarkHttpTreeMux_ParamWrite  2000000           851 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_ParamWrite    5000000           636 ns/op          58 B/op          3 allocs/op
BenchmarkMartini_ParamWrite   200000          8298 ns/op        1287 B/op         16 allocs/op
BenchmarkPat_ParamWrite   500000          4045 ns/op        1129 B/op         19 allocs/op
BenchmarkTigerTonic_ParamWrite    500000          6124 ns/op        1485 B/op         25 allocs/op
BenchmarkTraffic_ParamWrite   200000          8771 ns/op        2464 B/op         27 allocs/op
BenchmarkBeego_GithubStatic   500000          3187 ns/op         821 B/op         14 allocs/op
BenchmarkDenco_GithubStatic 20000000            85.1 ns/op         0 B/op          0 allocs/op
BenchmarkGocraftWeb_GithubStatic     1000000          1418 ns/op         314 B/op          6 allocs/op
BenchmarkGoji_GithubStatic   5000000           553 ns/op           0 B/op          0 allocs/op
BenchmarkGoJsonRest_GithubStatic      500000          6594 ns/op        1162 B/op         26 allocs/op
BenchmarkGorillaMux_GithubStatic       50000         48178 ns/op         460 B/op          6 allocs/op
BenchmarkHttpRouter_GithubStatic    20000000            76.0 ns/op         0 B/op          0 allocs/op
BenchmarkHttpTreeMux_GithubStatic   20000000            75.8 ns/op         0 B/op          0 allocs/op
BenchmarkKocha_GithubStatic 20000000           123 ns/op           0 B/op          0 allocs/op
BenchmarkMartini_GithubStatic     100000         24472 ns/op         862 B/op         12 allocs/op
BenchmarkPat_GithubStatic     100000         16136 ns/op        3789 B/op         76 allocs/op
BenchmarkTigerTonic_GithubStatic     5000000           446 ns/op          49 B/op          1 allocs/op
BenchmarkTraffic_GithubStatic      20000         88844 ns/op       23368 B/op        172 allocs/op
BenchmarkBeego_GithubParam    500000          4735 ns/op        1245 B/op         18 allocs/op
BenchmarkDenco_GithubParam   2000000           994 ns/op         116 B/op          3 allocs/op
BenchmarkGocraftWeb_GithubParam   500000          2815 ns/op         737 B/op         10 allocs/op
BenchmarkGoji_GithubParam    1000000          1786 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_GithubParam   200000         10054 ns/op        2192 B/op         33 allocs/op
BenchmarkGorillaMux_GithubParam    50000         31640 ns/op         819 B/op          7 allocs/op
BenchmarkHttpRouter_GithubParam  5000000           452 ns/op          98 B/op          1 allocs/op
BenchmarkHttpTreeMux_GithubParam     1000000          1304 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_GithubParam   1000000          1129 ns/op         132 B/op          5 allocs/op
BenchmarkMartini_GithubParam       50000         33193 ns/op        1220 B/op         13 allocs/op
BenchmarkPat_GithubParam      200000         10578 ns/op        2628 B/op         56 allocs/op
BenchmarkTigerTonic_GithubParam   200000          6432 ns/op        1484 B/op         28 allocs/op
BenchmarkTraffic_GithubParam       50000         37349 ns/op        7152 B/op         60 allocs/op
BenchmarkBeego_GithubAll        2000       1065850 ns/op      240491 B/op       3584 allocs/op
BenchmarkDenco_GithubAll       10000        167449 ns/op       21353 B/op        508 allocs/op
BenchmarkGocraftWeb_GithubAll       5000        516241 ns/op      136593 B/op       1915 allocs/op
BenchmarkGoji_GithubAll     2000        893455 ns/op       57363 B/op        347 allocs/op
BenchmarkGoJsonRest_GithubAll       1000       1984326 ns/op      407513 B/op       6558 allocs/op
BenchmarkGorillaMux_GithubAll        100      19408668 ns/op      153479 B/op       1420 allocs/op
BenchmarkHttpRouter_GithubAll      20000         78090 ns/op       14101 B/op        169 allocs/op
BenchmarkHttpTreeMux_GithubAll     10000        182227 ns/op       57365 B/op        347 allocs/op
BenchmarkKocha_GithubAll       10000        208182 ns/op       24063 B/op        847 allocs/op
BenchmarkMartini_GithubAll       100      12874177 ns/op      245658 B/op       2942 allocs/op
BenchmarkPat_GithubAll       500       6100295 ns/op     1589303 B/op      32576 allocs/op
BenchmarkTigerTonic_GithubAll       2000       1302858 ns/op      251030 B/op       6087 allocs/op
BenchmarkTraffic_GithubAll       100      17070060 ns/op     3175411 B/op      24953 allocs/op
BenchmarkBeego_GPlusStatic    500000          3037 ns/op         804 B/op         14 allocs/op
BenchmarkDenco_GPlusStatic  50000000            48.1 ns/op         0 B/op          0 allocs/op
BenchmarkGocraftWeb_GPlusStatic  1000000          1419 ns/op         297 B/op          6 allocs/op
BenchmarkGoji_GPlusStatic    5000000           438 ns/op           0 B/op          0 allocs/op
BenchmarkGoJsonRest_GPlusStatic   500000          7296 ns/op        1146 B/op         26 allocs/op
BenchmarkGorillaMux_GPlusStatic   500000          4803 ns/op         460 B/op          6 allocs/op
BenchmarkHttpRouter_GPlusStatic 50000000            44.3 ns/op         0 B/op          0 allocs/op
BenchmarkHttpTreeMux_GPlusStatic    50000000            43.5 ns/op         0 B/op          0 allocs/op
BenchmarkKocha_GPlusStatic  20000000            88.3 ns/op         0 B/op          0 allocs/op
BenchmarkMartini_GPlusStatic      500000          6673 ns/op         862 B/op         12 allocs/op
BenchmarkPat_GPlusStatic     5000000           446 ns/op          99 B/op          2 allocs/op
BenchmarkTigerTonic_GPlusStatic 10000000           254 ns/op          33 B/op          1 allocs/op
BenchmarkTraffic_GPlusStatic      500000          5975 ns/op        1513 B/op         19 allocs/op
BenchmarkBeego_GPlusParam     500000          4392 ns/op        1180 B/op         17 allocs/op
BenchmarkDenco_GPlusParam    5000000           484 ns/op          50 B/op          2 allocs/op
BenchmarkGocraftWeb_GPlusParam   1000000          2288 ns/op         673 B/op          9 allocs/op
BenchmarkGoji_GPlusParam     1000000          1436 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_GPlusParam    200000         11334 ns/op        1821 B/op         30 allocs/op
BenchmarkGorillaMux_GPlusParam    200000         11297 ns/op         786 B/op          7 allocs/op
BenchmarkHttpRouter_GPlusParam   5000000           299 ns/op          65 B/op          1 allocs/op
BenchmarkHttpTreeMux_GPlusParam  2000000           874 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_GPlusParam    5000000           655 ns/op          58 B/op          3 allocs/op
BenchmarkMartini_GPlusParam   200000         10901 ns/op        1187 B/op         13 allocs/op
BenchmarkPat_GPlusParam  1000000          2858 ns/op         753 B/op         14 allocs/op
BenchmarkTigerTonic_GPlusParam    500000          4615 ns/op        1103 B/op         19 allocs/op
BenchmarkTraffic_GPlusParam   200000         10742 ns/op        2043 B/op         23 allocs/op
BenchmarkBeego_GPlus2Params   200000          5683 ns/op        1244 B/op         18 allocs/op
BenchmarkDenco_GPlus2Params  2000000           987 ns/op         116 B/op          3 allocs/op
BenchmarkGocraftWeb_GPlus2Params     1000000          2731 ns/op         736 B/op         10 allocs/op
BenchmarkGoji_GPlus2Params   1000000          2037 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_GPlus2Params      200000         10705 ns/op        2195 B/op         33 allocs/op
BenchmarkGorillaMux_GPlus2Params      100000         28040 ns/op         819 B/op          7 allocs/op
BenchmarkHttpRouter_GPlus2Params     5000000           337 ns/op          65 B/op          1 allocs/op
BenchmarkHttpTreeMux_GPlus2Params    2000000          1136 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_GPlus2Params  1000000          1144 ns/op         132 B/op          5 allocs/op
BenchmarkMartini_GPlus2Params      50000         34688 ns/op        1320 B/op         17 allocs/op
BenchmarkPat_GPlus2Params     200000          8651 ns/op        2403 B/op         41 allocs/op
BenchmarkTigerTonic_GPlus2Params      500000          7717 ns/op        1586 B/op         28 allocs/op
BenchmarkTraffic_GPlus2Params      50000         29947 ns/op        3627 B/op         35 allocs/op
BenchmarkBeego_GPlusAll    50000         62392 ns/op       14947 B/op        223 allocs/op
BenchmarkDenco_GPlusAll   200000          9128 ns/op         887 B/op         27 allocs/op
BenchmarkGocraftWeb_GPlusAll       50000         31896 ns/op        8352 B/op        117 allocs/op
BenchmarkGoji_GPlusAll    100000         18817 ns/op        3775 B/op         22 allocs/op
BenchmarkGoJsonRest_GPlusAll       10000        122218 ns/op       24098 B/op        402 allocs/op
BenchmarkGorillaMux_GPlusAll       10000        174504 ns/op        9730 B/op         91 allocs/op
BenchmarkHttpRouter_GPlusAll      500000          3877 ns/op         660 B/op         11 allocs/op
BenchmarkHttpTreeMux_GPlusAll     200000         10027 ns/op        3775 B/op         22 allocs/op
BenchmarkKocha_GPlusAll   200000          9599 ns/op        1014 B/op         43 allocs/op
BenchmarkMartini_GPlusAll      10000        196508 ns/op       15549 B/op        194 allocs/op
BenchmarkPat_GPlusAll      50000         70916 ns/op       17706 B/op        346 allocs/op
BenchmarkTigerTonic_GPlusAll       50000         73256 ns/op       15489 B/op        322 allocs/op
BenchmarkTraffic_GPlusAll      10000        233066 ns/op       42154 B/op        447 allocs/op
BenchmarkBeego_ParseStatic    500000          3606 ns/op         821 B/op         14 allocs/op
BenchmarkDenco_ParseStatic  50000000            60.8 ns/op         0 B/op          0 allocs/op
BenchmarkGocraftWeb_ParseStatic  1000000          1401 ns/op         314 B/op          6 allocs/op
BenchmarkGoji_ParseStatic    5000000           608 ns/op           0 B/op          0 allocs/op
BenchmarkGoJsonRest_ParseStatic   500000          7214 ns/op        1146 B/op         26 allocs/op
BenchmarkGorillaMux_ParseStatic   200000          9809 ns/op         460 B/op          6 allocs/op
BenchmarkHttpRouter_ParseStatic 50000000            51.4 ns/op         0 B/op          0 allocs/op
BenchmarkHttpTreeMux_ParseStatic    20000000            79.0 ns/op         0 B/op          0 allocs/op
BenchmarkKocha_ParseStatic  20000000           107 ns/op           0 B/op          0 allocs/op
BenchmarkMartini_ParseStatic      500000          7797 ns/op         862 B/op         12 allocs/op
BenchmarkPat_ParseStatic     1000000          1250 ns/op         249 B/op          5 allocs/op
BenchmarkTigerTonic_ParseStatic  5000000           412 ns/op          49 B/op          1 allocs/op
BenchmarkTraffic_ParseStatic      200000         11557 ns/op        2395 B/op         25 allocs/op
BenchmarkBeego_ParseParam     500000          4492 ns/op        1196 B/op         17 allocs/op
BenchmarkDenco_ParseParam    5000000           526 ns/op          50 B/op          2 allocs/op
BenchmarkGocraftWeb_ParseParam   1000000          2268 ns/op         689 B/op          9 allocs/op
BenchmarkGoji_ParseParam     1000000          1509 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_ParseParam    200000          9156 ns/op        1807 B/op         30 allocs/op
BenchmarkGorillaMux_ParseParam    200000          9726 ns/op         786 B/op          7 allocs/op
BenchmarkHttpRouter_ParseParam  10000000           263 ns/op          65 B/op          1 allocs/op
BenchmarkHttpTreeMux_ParseParam  2000000           936 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_ParseParam    5000000           629 ns/op          58 B/op          3 allocs/op
BenchmarkMartini_ParseParam   200000         10959 ns/op        1187 B/op         13 allocs/op
BenchmarkPat_ParseParam   500000          4245 ns/op        1197 B/op         20 allocs/op
BenchmarkTigerTonic_ParseParam    500000          4236 ns/op        1084 B/op         19 allocs/op
BenchmarkTraffic_ParseParam   200000          9281 ns/op        2329 B/op         25 allocs/op
BenchmarkBeego_Parse2Params   500000          4585 ns/op        1244 B/op         18 allocs/op
BenchmarkDenco_Parse2Params  2000000           755 ns/op         116 B/op          3 allocs/op
BenchmarkGocraftWeb_Parse2Params     1000000          2579 ns/op         736 B/op         10 allocs/op
BenchmarkGoji_Parse2Params   1000000          1433 ns/op         343 B/op          2 allocs/op
BenchmarkGoJsonRest_Parse2Params      200000          9785 ns/op        2166 B/op         33 allocs/op
BenchmarkGorillaMux_Parse2Params      200000         10083 ns/op         819 B/op          7 allocs/op
BenchmarkHttpRouter_Parse2Params     5000000           292 ns/op          65 B/op          1 allocs/op
BenchmarkHttpTreeMux_Parse2Params    2000000           947 ns/op         343 B/op          2 allocs/op
BenchmarkKocha_Parse2Params  2000000           943 ns/op         132 B/op          5 allocs/op
BenchmarkMartini_Parse2Params     200000         10054 ns/op        1220 B/op         13 allocs/op
BenchmarkPat_Parse2Params     500000          3669 ns/op         908 B/op         21 allocs/op
BenchmarkTigerTonic_Parse2Params      500000          6553 ns/op        1488 B/op         28 allocs/op
BenchmarkTraffic_Parse2Params     200000          9363 ns/op        2134 B/op         25 allocs/op
BenchmarkBeego_ParseAll    10000        103330 ns/op       27503 B/op        420 allocs/op
BenchmarkDenco_ParseAll   200000         11258 ns/op        1008 B/op         35 allocs/op
BenchmarkGocraftWeb_ParseAll       50000         51958 ns/op       14318 B/op        210 allocs/op
BenchmarkGoji_ParseAll    100000         29556 ns/op        5491 B/op         33 allocs/op
BenchmarkGoJsonRest_ParseAll       10000        211105 ns/op       41617 B/op        759 allocs/op
BenchmarkGorillaMux_ParseAll        5000        380477 ns/op       17274 B/op        175 allocs/op
BenchmarkHttpRouter_ParseAll      500000          5238 ns/op         665 B/op         16 allocs/op
BenchmarkHttpTreeMux_ParseAll     200000         15440 ns/op        5491 B/op         33 allocs/op
BenchmarkKocha_ParseAll   200000         15235 ns/op        1160 B/op         54 allocs/op
BenchmarkMartini_ParseAll      10000        252829 ns/op       27712 B/op        333 allocs/op
BenchmarkPat_ParseAll      20000         78359 ns/op       18294 B/op        385 allocs/op
BenchmarkTigerTonic_ParseAll       20000         99349 ns/op       20868 B/op        420 allocs/op
BenchmarkTraffic_ParseAll      10000        331941 ns/op       70677 B/op        763 allocs/op
BenchmarkHttpServeMux_StaticAll     1000       1634267 ns/op         104 B/op          8 allocs/op
BenchmarkBeego_StaticAll        5000        539431 ns/op      128898 B/op       2226 allocs/op
BenchmarkDenco_StaticAll      100000         19368 ns/op           0 B/op          0 allocs/op
BenchmarkGocraftWeb_StaticAll      10000        263807 ns/op       49239 B/op        951 allocs/op
BenchmarkGoji_StaticAll    10000        128495 ns/op           0 B/op          0 allocs/op
BenchmarkGoJsonRest_StaticAll       2000       1202367 ns/op      183070 B/op       4129 allocs/op
BenchmarkGorillaMux_StaticAll        500       6412376 ns/op       72384 B/op        966 allocs/op
BenchmarkHttpRouter_StaticAll     100000         25137 ns/op           0 B/op          0 allocs/op
BenchmarkHttpTreeMux_StaticAll    100000         25813 ns/op           0 B/op          0 allocs/op
BenchmarkKocha_StaticAll       50000         36208 ns/op           0 B/op          0 allocs/op
BenchmarkMartini_StaticAll       500       6262839 ns/op      145782 B/op       2521 allocs/op
BenchmarkPat_StaticAll      1000       2381715 ns/op      554324 B/op      11250 allocs/op
BenchmarkTigerTonic_StaticAll      20000         85906 ns/op        7780 B/op        158 allocs/op
BenchmarkTraffic_StaticAll       100      14011627 ns/op     3797675 B/op      27948 allocs/op
ok      github.com/julienschmidt/go-http-routing-benchmark  500.277s
julienschmidt commented 10 years ago

The code was checked out automatically with go get yesterday. Do you have a go1 tag set?

astaxie commented 10 years ago

I have no go1 tag. I think maybe I use the develop branch. So in the beego new version the router has changed a lot. I will release later. and will send you a pull request. and then please update your test case again. Thanks for your test case code. It's really useful for me to profile my programe.

julienschmidt commented 10 years ago

The benchmark was run with https://github.com/astaxie/beego/commit/3e4c01598298f31f62441af9b6a1fb520e4ec285.

The results also depend on the go version and the hardware of course. Some results seem suspicious slow in the logs in the first post.

Unless the API of beego changes, I don't need a PR. I will not merge results from other persons. Just notify me and I'll run the benchmark again.

astaxie commented 10 years ago
-       app := beego.NewApp()
+       app := beego.NewControllerRegister()
-const fiveBeego = "/:a!/:b!/:c!/:d!/:e!"
+const fiveBeego = "/:a/:b/:c/:d/:e"
-       router := loadBeegoSingle("GET", "/user/:name!", beegoHandler)
+       router := loadBeegoSingle("GET", "/user/:name", beegoHandler)
-const twentyBeego = "/:a!/:b!/:c!/:d!/:e!/:f!/:g!/:h!/:i!/:j!/:k!/:l!/:m!/:n!/:o!/:p!/:q!/:r!/:s!/:t!"
+const twentyBeego = "/:a/:b/:c/:d/:e/:f/:g/:h/:i/:j/:k/:l/:m/:n/:o/:p/:q/:r/:s/:t"

like this modify. should I send the pull request?

julienschmidt commented 10 years ago

You could remove the fiveBeego and twentyBeego constants and then and use fiveColon / twentyColon instead.

But this makes beego also accept for example GET /user/ for the handle beegoHandle, right? This is not really intended. Is it significantly faster?

astaxie commented 10 years ago

in the new version, it's will not accept GET /user/. In fact it act as GocraftWeb. when I release I will send you pull request. actually in the new version if you want to accept should use /?:id

astaxie commented 10 years ago

can you retest for the new code?

julienschmidt commented 10 years ago

I will definitely do a re-run soon (also including Gin as a new framework), but I currently don't have time for it. Please have patience.

astaxie commented 10 years ago

Looking forward to the new result. And also add revel test if can

ymg commented 10 years ago

Just wondering, is this repository going to get updates after a number of frameworks had new releases?

julienschmidt commented 10 years ago

Yes, round 2 is scheduled for august.

ymg commented 10 years ago

great. thanks for the quick response :+1:

ghost commented 10 years ago

Hi! Maybe you could add Falcore, I've seen it on the latest TechEmpower benchmark (http://www.techempower.com/benchmarks/#section=data-r9): https://github.com/fitstar/falcore

julienschmidt commented 10 years ago

First results are in. I can confirm that Beego improved a lot :+1: Final results will be released in 1-2 days.

Falcore is not suitable for a benchmark like this. I doubt at all, that it is suitable for any application with more than 2-3 handler functions. Or maybe I did not understand the concept. Pull requests welcome in that case :smiley:

astaxie commented 10 years ago

:+1:

astaxie commented 10 years ago

hi @julienschmidt. when will the final results released?

julienschmidt commented 10 years ago

Sorry for the delay. I found a few smaller problems, which should be addressed. Unfortunately I got very busy then. The final results will be released within the next few days.

julienschmidt commented 9 years ago

Bad news everyone! The 2nd round was planned since a long time, but so far I was unable to do it. The main reason is that I am currently about 10200 km away from my benchmark system. The usual SSH login didn't work and today I sent someone to take a look. It seems like there is a hardware defect :worried:

I will now search for another suitable system (I want a completely idle, freshly set-up system with suitable hardware, e.g. no notebook CPUs).

maximveksler commented 9 years ago

I went ahead and ran a bench on my very not sterile macbook air, all while running Safari and stuff. Still some data is better then none, and it does shows gross estimates (enough for me, at least for now). In case anyone is interested, it gist is here https://gist.github.com/maximveksler/f336875ed081e4b4cc46

I did some manual fixing of indentation there, to make the output more readable. FYI.

ant0ine commented 9 years ago

Another run on my MacBook Air https://gist.github.com/ant0ine/3caede217dda281dcedb It would be cool the update the README, things have changed since last June.

denji commented 9 years ago

golang/go@52c84c34fdb7c28d8f5c32458bad84b096af2797 (v1.5) bench on my iMac11 go test -bench=. -timeout=20m https://gist.github.com/denji/ace53cc308557422ecfa

syscrusher commented 9 years ago

go test -bench=. -timeout=180m -benchtime 10s

Intel Xeon E3-1230v3 (4x 3.30GHz + Turbo Boost 2.0 up to 3.7GHz) 2x 8GiB DDR3-1600 RAM, dual-channel, ECC go version go1.4.2 freebsd/amd64 FreeBSD 10.1-RELEASE-p5, clean installation

https://gist.github.com/syscrusher/82096fed0b4724bf3a56