docs: compile with -m speed, speed-profile silently degrades

`cmd package compile -m speed-profile -f` right after an install finds no
collected profile, compiles nothing and leaves the app at status=verify —
worse, it replaces an existing full-AOT odex with the verify-only one
(measured twice on the TV, the second time straight after `-m speed`).
`-m speed` (8 s) needs no profile and works every time, so that is what
the install step now asks for.
This commit is contained in:
Jeena 2026-10-28 06:41:32 +00:00
parent 80b28c9fec
commit a6c3f56efe
2 changed files with 11 additions and 6 deletions

View file

@ -24,8 +24,10 @@ for TV) that talks to a PeerTube instance over its REST API v1.
- `./gradlew :app:assembleRelease` — the deliverable (R8, 3 MB)
- `./gradlew :app:lintDebug` — lint
- `adb connect <ip>:<port>` + `adb install -r app/build/outputs/apk/<variant>/app-<variant>.apk`,
then `adb shell cmd package compile -m speed-profile -f net.jeena.jtubetv` (3.5 s):
`adb install` leaves the APK `verify`-only, i.e. interpreted + JIT
then `adb shell cmd package compile -m speed -f net.jeena.jtubetv` (8 s):
`adb install` leaves the APK `verify`-only, i.e. interpreted + JIT. Use `speed`,
not `speed-profile`: with no collected profile the latter falls back to `verify`
and even replaces a good odex.
- This repo is local-only for now. If it gets a remote on git.jeena.net later, set the
repo-local deploy key pin right away:
`git config core.sshCommand "ssh -i ~/.ssh/agent-deploy-key -o IdentitiesOnly=yes"`

View file

@ -49,17 +49,20 @@ device logs `Large app, accepted running with swap`.
`adb install` on this TV leaves even the release APK at `status=verify`
(`[reason=install]`), although it ships `assets/dexopt/baseline.prof` and the
device compiles other apps `speed-profile` / `speed`. So the first runs after
every install are interpreted + JIT. One command fixes it, and it is cheap
because it uses the shipped profile:
every install are interpreted + JIT. One command fixes it:
```
adb shell cmd package compile -m speed-profile -f net.jeena.jtubetv # 3.5 s
adb shell cmd package compile -m speed -f net.jeena.jtubetv # 9 s, full AOT
adb shell cmd package compile -m speed -f net.jeena.jtubetv # 8 s, full AOT
```
That took the release build from p99 150 ms / 4 missed vsyncs to p99 69 ms /
none.
Do **not** use `-m speed-profile` right after an install: with no collected
profile it compiles nothing and leaves the app at `status=verify`, replacing an
existing full-AOT odex with a worse one (measured, twice). It only pays off on a
build that has already been used for a while; `speed` works every time.
## What to use instead
- Perf/behaviour checks on the TV: `./gradlew :app:assembleBench` →