You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[GIN-debug] GET /demo/test --> gaea/app/controller/democontroller.GaeaDemo (1 handlers)
41
+
2020/08/2614:40:02 [overseer slave#1] run
42
+
2020/08/2614:40:02 [overseer slave#1] start program
43
+
2020/08/2614:40:09 [overseer master] proxy signal (window changed)
43
44
44
-
4.Controller (mvc programming style)
45
-
```golang
46
-
//app/router/
47
-
funcGaeaDemo(ctx *gin.Context) {
48
-
goCtx:= xesgin.TransferToContext(ctx)
49
-
param:= ctx.PostForm("param")
50
-
ret, err:= demoservice.DoFun(goCtx, param)
51
-
if err != nil {
52
-
resp:= xesgin.Error(err)
53
-
ctx.JSON(http.StatusOK, resp)
54
-
} else {
55
-
resp:= xesgin.Success(ret)
56
-
ctx.JSON(http.StatusOK, resp)
57
-
}
58
-
}
59
45
```
60
46
61
-
5.Try it!
62
-
```
63
-
curl http://127.0.0.1:9898/demo/test
64
-
```
47
+
## Comparison of routing performance of major mainstream frameworks
48
+
49
+

50
+
51
+
(Picture to Resource Network)
52
+
53
+
#### Gaea Benchmark
54
+
Compared with the native Gin, the point that the Gaea framework affects performance is actually all concentrated on the middleware, because every http request will be run again, so observe the impact on the overall performance when each middle is turned on
* Gaea's default configuration will bring a certain amount of energy consumption, about 30%
71
+
* Among them, the `Logger` middleware has the largest impact on the performance of each middleware, and other middleware is almost negligible
72
+
73
+
*Note: The middleware in the test is used for testing and not open source*
74
+
75
+
In actual project applications, when [Log](https://github.com/tal-tech/loggerX) middleware is the bottleneck, we can close it or adjust the log level to `WARNING`
0 commit comments