mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-23 05:33:57 -04:00
remove pre-generated input corpus for PGO
This commit is contained in:
parent
001d309b81
commit
e1bde0b0e7
3 changed files with 45 additions and 13 deletions
24
INSTALL.md
24
INSTALL.md
|
|
@ -196,12 +196,32 @@ all code paths in foot is exercised. In particular, the **rendering**
|
||||||
code is not. As a result, the final binary built using this method is
|
code is not. As a result, the final binary built using this method is
|
||||||
slightly slower than when doing a [full PGO](#full-pgo) build.
|
slightly slower than when doing a [full PGO](#full-pgo) build.
|
||||||
|
|
||||||
We will use the `pgo` binary along with stimuli found in `<src>/pgo`:
|
We will use the `pgo` binary along with input corpus generated by
|
||||||
|
`scripts/generate-alt-random-writes.py`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./pgo ../../pgo/stimuli-*.raw
|
tmp_file=$(mktemp)
|
||||||
|
../../scripts/generate-alt-random-writes \
|
||||||
|
--rows=67 \
|
||||||
|
--cols=135 \
|
||||||
|
--scroll \
|
||||||
|
--scroll-region \
|
||||||
|
--colors-regular \
|
||||||
|
--colors-bright \
|
||||||
|
--colors-256 \
|
||||||
|
--colors-rgb \
|
||||||
|
${tmp_file}
|
||||||
|
./pgo ${tmp_file} ${tmp_file} ${tmp_file} ${tmp_file} ${tmp_file} ${tmp_file}
|
||||||
|
rm ${tmp_file}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The snippet above first creates an (empty) temporary file. Then, it
|
||||||
|
runs a script that generates random escape sequences (if you cat
|
||||||
|
`${tmp_file}` in a terminal, you’ll see random colored characters all
|
||||||
|
over the screen). Finally, we feed the randomly generated escape
|
||||||
|
sequences to the PGO helper. This is what generates the profiling data
|
||||||
|
used in the next step.
|
||||||
|
|
||||||
You are now ready to [use the generated PGO
|
You are now ready to [use the generated PGO
|
||||||
data](#use-the-generated-pgo-data).
|
data](#use-the-generated-pgo-data).
|
||||||
|
|
||||||
|
|
|
||||||
33
PKGBUILD
33
PKGBUILD
|
|
@ -1,5 +1,5 @@
|
||||||
pkgname=('foot-git' 'foot-terminfo-git')
|
pkgname=('foot-git' 'foot-terminfo-git')
|
||||||
pkgver=1.5.3
|
pkgver=1.5.3.r212.gd023cd3
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
url=https://codeberg.org/dnkl/foot
|
url=https://codeberg.org/dnkl/foot
|
||||||
|
|
@ -20,18 +20,31 @@ build() {
|
||||||
|
|
||||||
meson --prefix=/usr --buildtype=release --wrap-mode=nofallback -Db_lto=true ..
|
meson --prefix=/usr --buildtype=release --wrap-mode=nofallback -Db_lto=true ..
|
||||||
|
|
||||||
|
find -name "*.gcda" -delete
|
||||||
|
meson configure -Db_pgo=generate
|
||||||
|
ninja
|
||||||
|
|
||||||
|
script_options="--scroll --scroll-region --colors-regular --colors-bright --colors-256 --colors-rgb"
|
||||||
|
|
||||||
|
tmp_file=$(mktemp)
|
||||||
|
|
||||||
if [[ -v WAYLAND_DISPLAY ]]; then
|
if [[ -v WAYLAND_DISPLAY ]]; then
|
||||||
meson configure -Db_pgo=generate
|
./foot \
|
||||||
find -name "*.gcda" -delete
|
--config /dev/null \
|
||||||
ninja
|
--term=xterm \
|
||||||
|
sh -c "../scripts/generate-alt-random-writes.py ${script_options} ${tmp_file} && cat ${tmp_file}"
|
||||||
tmp_file=$(mktemp)
|
else
|
||||||
./foot --config /dev/null --term=xterm -- sh -c "../scripts/generate-alt-random-writes.py --scroll --scroll-region --colors-regular --colors-bright --colors-256 --colors-rgb ${tmp_file} && cat ${tmp_file}"
|
../scripts/generate-alt-random-writes.py \
|
||||||
rm "${tmp_file}"
|
--rows=67 \
|
||||||
|
--cols=135 \
|
||||||
meson configure -Db_pgo=use
|
${script_options} \
|
||||||
|
${tmp_file}
|
||||||
|
./pgo ${tmp_file} ${tmp_file} ${tmp_file} ${tmp_file} ${tmp_file} ${tmp_file}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm "${tmp_file}"
|
||||||
|
|
||||||
|
meson configure -Db_pgo=use
|
||||||
ninja
|
ninja
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue