From a299c0b82c37c346a7f251c35be01d8b7a2226ad Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Sat, 27 May 2023 12:37:32 +0800 Subject: [PATCH] feat: use jsoniter for improving gin performance --- .air.toml | 2 +- .github/workflows/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.air.toml b/.air.toml index 0e89e0ef..83b7a24f 100644 --- a/.air.toml +++ b/.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. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6db935d..e540b59c 100644 --- a/.github/workflows/build.yml +++ b/.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