Browse Source

feat: use jsoniter for improving gin performance

0xJacky 2 years ago
parent
commit
a299c0b82c
2 changed files with 2 additions and 2 deletions
  1. 1 1
      .air.toml
  2. 1 1
      .github/workflows/build.yml

+ 1 - 1
.air.toml

@@ -7,7 +7,7 @@ tmp_dir = "tmp"
 
 [build]
 # Just plain old shell command. You could use `make` as well.
-cmd = "CGO_ENABLED=1 go build -ldflags=\"-X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'\" -o ./tmp/main ."
+cmd = "CGO_ENABLED=1 go build -tags=jsoniter -ldflags=\"-X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'\" -o ./tmp/main ."
 # Binary file yields from `cmd`.
 bin = "tmp/main"
 # Customize binary.

+ 1 - 1
.github/workflows/build.yml

@@ -173,7 +173,7 @@ jobs:
             -   name: Build
                 run: |
                     mkdir -p dist
-                    go build -ldflags "$LD_FLAGS -X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'" -o dist/nginx-ui -v main.go
+                    go build -tags=jsoniter -ldflags "$LD_FLAGS -X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'" -o dist/nginx-ui -v main.go
 
             -   name: Archive backend artifacts
                 uses: actions/upload-artifact@v3