mirror of
https://codeberg.org/gigirassy/riptide
synced 2026-08-30 23:27:39 +00:00
Update .forgejo/workflows/pgo-binary.yml
This commit is contained in:
@@ -85,7 +85,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
/tmp/riptide-pgo/riptide --help
|
/tmp/riptide-pgo/riptide --help
|
||||||
|
|
||||||
- name: Train PGO profile
|
- name: Train PGO profile part 1
|
||||||
shell: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
LLVM_PROFILE_FILE: /tmp/riptide-pgo/profiles/%m-%p.profraw
|
LLVM_PROFILE_FILE: /tmp/riptide-pgo/profiles/%m-%p.profraw
|
||||||
@@ -93,8 +93,9 @@ jobs:
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
SITEMAP_URL='https://riptide-pgo.blitzw.in/sitemaps/sitemap.xml'
|
SITEMAP_URL='https://riptide-pgo.blitzw.in/sitemaps/sitemap.xml'
|
||||||
|
SITEMAP_URL_2='https://riptide-pgo.blitzw.in/sitemaps2/sitemap.xml'
|
||||||
|
|
||||||
printf 'Training with sitemap: <%s>\n' "$SITEMAP_URL"
|
printf 'Training round 1 with sitemap: <%s>\n' "$SITEMAP_URL"
|
||||||
|
|
||||||
timeout 10m \
|
timeout 10m \
|
||||||
/tmp/riptide-pgo/riptide \
|
/tmp/riptide-pgo/riptide \
|
||||||
@@ -106,9 +107,24 @@ jobs:
|
|||||||
|
|
||||||
test -s /tmp/pgo-urls.txt
|
test -s /tmp/pgo-urls.txt
|
||||||
|
|
||||||
echo "Training input:"
|
echo "Training round 1 input:"
|
||||||
wc -l /tmp/pgo-urls.txt
|
wc -l /tmp/pgo-urls.txt
|
||||||
|
|
||||||
|
printf 'Training round 2 with sitemap: <%s>\n' "$SITEMAP_URL_2"
|
||||||
|
|
||||||
|
timeout 10m \
|
||||||
|
/tmp/riptide-pgo/riptide \
|
||||||
|
--sitemap "$SITEMAP_URL_2" \
|
||||||
|
--output /tmp/pgo-urls-2.txt \
|
||||||
|
--scheme https \
|
||||||
|
--workers 16 \
|
||||||
|
--timeout-secs 30
|
||||||
|
|
||||||
|
test -s /tmp/pgo-urls-2.txt
|
||||||
|
|
||||||
|
echo "Training round 2 input:"
|
||||||
|
wc -l /tmp/pgo-urls-2.txt
|
||||||
|
|
||||||
echo "Generated profiles:"
|
echo "Generated profiles:"
|
||||||
find /tmp/riptide-pgo/profiles \
|
find /tmp/riptide-pgo/profiles \
|
||||||
-name '*.profraw' \
|
-name '*.profraw' \
|
||||||
@@ -122,7 +138,7 @@ jobs:
|
|||||||
-print -quit
|
-print -quit
|
||||||
)"
|
)"
|
||||||
|
|
||||||
- name: Merge PGO profiles
|
- name: Merge Round 1 of PGO profiles
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
@@ -135,7 +151,7 @@ jobs:
|
|||||||
|
|
||||||
test -s /tmp/riptide-pgo.profdata
|
test -s /tmp/riptide-pgo.profdata
|
||||||
|
|
||||||
- name: Build optimized Linux binary
|
- name: Build Linux binary 2
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
@@ -147,6 +163,92 @@ jobs:
|
|||||||
--release \
|
--release \
|
||||||
--target "$LINUX_TARGET"
|
--target "$LINUX_TARGET"
|
||||||
|
|
||||||
|
mkdir -p riptide-pgo-2
|
||||||
|
|
||||||
|
cp \
|
||||||
|
"target/$LINUX_TARGET/release/riptide" \
|
||||||
|
riptide-pgo-2/riptide
|
||||||
|
|
||||||
|
chmod +x riptide-pgo-2/riptide
|
||||||
|
|
||||||
|
- name: Train PGO profile
|
||||||
|
shell: sh
|
||||||
|
env:
|
||||||
|
LLVM_PROFILE_FILE: /tmp/riptide-pgo/profiles/%m-%p.profraw
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
SITEMAP_URL='https://riptide-pgo.blitzw.in/sitemaps/sitemap.xml'
|
||||||
|
SITEMAP_URL_2='https://riptide-pgo.blitzw.in/sitemaps2/sitemap.xml'
|
||||||
|
|
||||||
|
printf 'Training round 1 with sitemap: <%s>\n' "$SITEMAP_URL"
|
||||||
|
|
||||||
|
timeout 10m \
|
||||||
|
/tmp/riptide-pgo2/riptide \
|
||||||
|
--sitemap "$SITEMAP_URL" \
|
||||||
|
--output /tmp/pgo-urls3.txt \
|
||||||
|
--scheme https \
|
||||||
|
--workers 16 \
|
||||||
|
--timeout-secs 30
|
||||||
|
|
||||||
|
test -s /tmp/pgo-urls3.txt
|
||||||
|
|
||||||
|
echo "Training round 1 input:"
|
||||||
|
wc -l /tmp/pgo-urls3.txt
|
||||||
|
|
||||||
|
printf 'Training round 2 with sitemap: <%s>\n' "$SITEMAP_URL_2"
|
||||||
|
|
||||||
|
timeout 10m \
|
||||||
|
/tmp/riptide-pgo2/riptide \
|
||||||
|
--sitemap "$SITEMAP_URL_2" \
|
||||||
|
--output /tmp/pgo-urls-4.txt \
|
||||||
|
--scheme https \
|
||||||
|
--workers 16 \
|
||||||
|
--timeout-secs 30
|
||||||
|
|
||||||
|
test -s /tmp/pgo-urls-4.txt
|
||||||
|
|
||||||
|
echo "Training round 2 input:"
|
||||||
|
wc -l /tmp/pgo-urls-4.txt
|
||||||
|
|
||||||
|
echo "Generated profiles:"
|
||||||
|
find /tmp/riptide-pgo2/profiles \
|
||||||
|
-name '*.profraw' \
|
||||||
|
-type f \
|
||||||
|
-print
|
||||||
|
|
||||||
|
test -n "$(
|
||||||
|
find /tmp/riptide-pgo2/profiles \
|
||||||
|
-name '*.profraw' \
|
||||||
|
-type f \
|
||||||
|
-print -quit
|
||||||
|
)"
|
||||||
|
|
||||||
|
- name: Merge Round 2 of PGO profiles
|
||||||
|
shell: sh
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
LLVM_PROFDATA="${{ steps.llvm.outputs.LLVM_BIN }}/llvm-profdata"
|
||||||
|
|
||||||
|
"$LLVM_PROFDATA" merge \
|
||||||
|
-o /tmp/riptide-pgo2.profdata \
|
||||||
|
/tmp/riptide-pgo2/profiles/*.profraw
|
||||||
|
|
||||||
|
test -s /tmp/riptide-pgo.profdata
|
||||||
|
|
||||||
|
- name: Build finalized Linux binary
|
||||||
|
shell: sh
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
RUSTFLAGS="
|
||||||
|
-C target-feature=+crt-static
|
||||||
|
-C profile-use=/tmp/riptide-pgo2.profdata
|
||||||
|
" cargo build \
|
||||||
|
--release \
|
||||||
|
--target "$LINUX_TARGET"
|
||||||
|
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
|
||||||
cp \
|
cp \
|
||||||
|
|||||||
Reference in New Issue
Block a user