Browse Source

bypass encoding/json and use instead jsoniter (#6001)

The package encoding/json is well known for being slow, this change fix this issue.
https://gin-gonic.com/docs/jsoniter/
Henri Lepic 4 years ago
parent
commit
57e2b16e8b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      frameworks/Go/gin/gin-scratch.dockerfile

+ 2 - 2
frameworks/Go/gin/gin-scratch.dockerfile

@@ -11,8 +11,8 @@ RUN apk update \
     go mod download
     go mod download
 
 
 RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
 RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
-    go build -ldflags="-s -w" -o server /gin/*.go
-
+    go build -tags=jsoniter -ldflags="-s -w" -o server /gin/*.go
+    
 RUN apk --no-cache add --update ca-certificates
 RUN apk --no-cache add --update ca-certificates
 
 
 # release layer
 # release layer