diff --git a/.dockerignore b/.dockerignore index 7e4ec6ee..20fa8b8c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,6 +10,7 @@ /dev/conduit-db /dev/psql /vcpkg +/libheif # Generated files assets.bin.go diff --git a/.github/workflows/download_pgo.yml b/.github/workflows/download_pgo.yml new file mode 100644 index 00000000..3daefabb --- /dev/null +++ b/.github/workflows/download_pgo.yml @@ -0,0 +1,17 @@ +name: "Update PGO performance profile" +on: +# schedule: +# - cron: "0 0 * * 2" # Every Tuesday at 00:00 + workflow_dispatch: +jobs: + update_providers: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - name: "Download new pgo_media_repo.pprof" + run: "curl -s --fail -X POST -H \"Authorization: Bearer ${PGO_MERGE}\" https://pgo-mmr.t2host.io/v1/merge?and_combine=true > pgo_media_repo.pprof" + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Update pgo_media_repo.pprof" diff --git a/.gitignore b/.gitignore index 7e4ec6ee..20fa8b8c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /dev/conduit-db /dev/psql /vcpkg +/libheif # Generated files assets.bin.go diff --git a/build-dist.sh b/build-dist.sh index 4dba4efd..2eac9f9d 100644 --- a/build-dist.sh +++ b/build-dist.sh @@ -18,6 +18,7 @@ do pth="$os-$arch" mkdir $PWD/bin/$pth GOOS=$os GOARCH=$arch GOBIN=$PWD/bin go build -o $PWD/bin/$pth -a -ldflags "-X github.com/turt2live/matrix-media-repo/common/version.GitCommit=$(git rev-list -1 HEAD) -X github.com/turt2live/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/... + GOOS=$os GOARCH=$arch GOBIN=$PWD/bin go build -pgo=pgo_media_repo.pprof -o $PWD/bin/$pth -a -ldflags "-X github.com/turt2live/matrix-media-repo/common/version.GitCommit=$(git rev-list -1 HEAD) -X github.com/turt2live/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/media_repo cd $PWD/bin/$pth if [ "$arch" == "amd64" ]; then arch="x64" diff --git a/build.sh b/build.sh index f7193782..d74cfb77 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,8 @@ #!/bin/sh +set -ex + GOBIN=$PWD/bin go install -v ./cmd/compile_assets $PWD/bin/compile_assets GOBIN=$PWD/bin go install -ldflags "-X github.com/turt2live/matrix-media-repo/common/version.GitCommit=$(git rev-list -1 HEAD) -X github.com/turt2live/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/... +GOBIN=$PWD/bin go install -pgo=pgo_media_repo.pprof -ldflags "-X github.com/turt2live/matrix-media-repo/common/version.GitCommit=$(git rev-list -1 HEAD) -X github.com/turt2live/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/media_repo diff --git a/pgo_media_repo.pprof b/pgo_media_repo.pprof new file mode 100644 index 00000000..d11e2291 Binary files /dev/null and b/pgo_media_repo.pprof differ