Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

#486 perf(release): attribute Tauri installer size and safely optimize native/frontend bundles

open

Opened by jweng10 · last month

jweng10opened this issueAuthor· last month

Current measured disposition (2026-10-19 UTC)

  • PR #543's non-blocking attribution report remains the implementation baseline. PR #541 merged normally as 5790271d80f0d8bf0f50b76de989ce549fb8dbca after CI Gate and Packaging Gate passed on source 66f9bc525c8b573929a7e2a51d3eb8acaf90248f. This dependency repair is not an optimization or platform acceptance result.
  • Reused that exact source's preserved local frontend build without a rebuild. Emitted uncompressed assets: 13 JavaScript files 2,530,796 bytes; one CSS file 84,125 bytes; 12 Japanese dictionary files 17,791,956 bytes; HTML/other 49,206 bytes. Total 20,456,083 bytes. This is not the Windows dist-only subtotal, a compressed installer size, or a before/after benchmark. File sizes and SHA256 values are recorded in the local emitted-assets report.
  • Cargo feature/duplicate inspection and AppImage squashfs attribution are recorded in the prior measured report. Keep reachable ORT providers, Symphonia codecs, dynamic runtime support and the Japanese dictionary. The worker already loads romanization dynamically; the emitted language chunks do not demonstrate dead assets. No safe removable feature/asset or supported WebKit/GTK replacement has been established.
  • Keep strip/fat LTO/opt-level s/single codegen as baseline and UPX disabled by default. Reject unproven dictionary/runtime pruning and chunk reshuffling as a claimed installed-size win. No arbitrary source optimization was introduced.

Next TODO — still OPEN

  • Only test a concrete supported optimization hypothesis with exact-head, same-format before/after attribution; profile/panic changes additionally require native audio/FFI and performance evidence.
  • Complete supported-platform installed-app, signature/updater and applicable Nightly evidence, plus playback/import/export/separation/provider/runtime/romanization/offline acceptance. Local frontend tests and a macOS debug build do not replace these checks.
  • Retain the original implementation and acceptance checklist below. Do not close this issue from maintenance CI or this audit.

Goal

Make actual installed and downloaded OpenKara releases leaner without compromising audio processing, ML model/runtime installation, app startup, or updater/signature integrity.

Verified baseline (2026-10-08)

  • src-tauri/Cargo.toml already uses [profile.release] strip = true, lto = \"fat\", opt-level = \"s\", codegen-units = 1 — most of Tauri's own size recommendations are already present.
  • Tauri v2 src-tauri/tauri.conf.json: release targets macOS app/DMG, Windows NSIS, Linux AppImage/deb; updater uses signed artifacts. bundle.resources lists OAuth and icon resources. Backend includes ort with load-dynamic and various hardware EP options, audio libraries and image codecs. Do not presume model weights or inference DLLs are embedded: inventory actual bundles first.
  • vite.config.ts: kuromojiDictPlugin copies dictionary assets into public/dict; measure their actual contribution and validate Japanese romanization before pruning.
  • Published v0.14.0: Linux amd64 AppImage ~99.29 MiB vs deb ~25.93 MiB, macOS arm64 DMG ~25.14 MiB, Windows NSIS ~23.22 MiB; different installer formats include different runtimes/overheads.
  • Release pipeline has elaborate Nightly evidence/installed-app smoke gates. Existing performance and runtime-infrastructure issues must remain the owners of their own changes.

Implementation

  • Create stage-wise attribution: Rust exe, Web frontend dist JS/CSS, public/dict, bundled macOS assets, native libraries and optional runtime files, final app/DMG/NSIS/deb/AppImage. Report both uncompressed installed footprint and compressed downloads, grouped by OS/arch; do not treat AppImage/deb byte delta as pure optimizer savings.
  • Use Cargo tree -e features, tree -d and Tauri's official guide to identify safe, demonstrably unused default features or native asset duplication. Keep ort providers, audio codecs, hardware capabilities and dynamic runtime resolution required by currently shipped features.
  • Analyze Vite output (bundle/chunk reports and emitted asset list); remove only genuinely unreachable JS/CSS/dependencies/assets, without deferring critical window bootstrap work or breaking offline/app asset URLs. In particular test lyric romanization and kuromoji dictionaries.
  • Keep existing Fat LTO, opt-level=\"s\", single codegen unit and strip as baseline, not tasks to re-add. Evaluate panic=\"abort\" only with explicit native audio/FFI crash/cleanup review; avoid untested changes in unwind semantics. Try z vs s only if a reproducible baseline shows a plausible benefit and real audio/export performance is measured.
  • For the unusually large AppImage, inspect its actual squashfs contents and runtime/libraries; compare changes against an AppImage baseline, and confirm AppImage launch on supported Linux before removing anything. Document necessary platform dependencies rather than replacing the installer format casually.
  • Add a non-blocking size report to release/nightly evidence, preserving Tauri updater .sig, release latest.json, bundle identifiers, Windows installer behavior, macOS signatures and the existing Nightly-to-Release evidence chain. Do any binary/resource transforms before signing.
  • Keep UPX disabled by default for production macOS/Windows/Tauri installers; only record a Linux experiment if it produces measurable real-archive benefit and passes native startup/update tests.

Acceptance

  • pnpm build, Rust checks, installed-app smoke, required Nightly release evidence and Tauri updater verification continue passing on all platforms.
  • Audio playback, import/export, separation/runtime download, hardware fallbacks, romanization and offline behavior remain intact.
  • A per-component/per-installer size report and written keep/reject decisions back every modification; no arbitrary percent reduction target.

Official docs

  • Tauri app-size guide: https://v2.tauri.app/concept/size/
  • Rust Cargo profiles: doc.rust-lang.org/cargo/…/profiles.html
  • Dependency features: doc.rust-lang.org/cargo/…/cargo-tree.html
  • Tauri updater docs: https://v2.tauri.app/plugin/updater/
devcommented· 3 weeks ago

Implemented in PR #543 at head c7d869b9617bd1c1063f02546aac2f6a7612a3d7 (pending required CI).

  • Reusable Linux/macOS/Windows installed-app builds now emit non-blocking per-platform reports covering frontend output, the separate kuromoji dictionary, Rust executable, ONNX Runtime input, bundle contents, and final AppImage/deb/DMG/NSIS/updater files.
  • Formal releases merge available reports into release-size-report.json; nightly publishes bundle-size-report.json.
  • Existing canonical release-evidence.json, updater/signing paths, release gates, and nightly updater isolation are unchanged.
  • Local focused contract tests: 45 passed; jactionlint and oxlint passed; pre-push passed 214 files / 2,413 tests, format, Cargo format, knip, patch coverage, and standards checks.

No optimizer or runtime capability was removed; remaining #486 optimization/reject decisions require measured reports after this lands.

devcommented· 3 weeks ago

Published v0.16.2 baseline (release published 2026-10-17, commit bf9bb5603b3267df5e27c84b48ab0125d956efc6) confirms the consumer formats and compressed sizes that the report must preserve:

  • macOS arm64 DMG: 25,433,171 bytes; Intel DMG: 26,439,894 bytes.
  • macOS updater archives: arm64 25,492,753 bytes; Intel 26,426,204 bytes.
  • Linux AppImage: 104,196,600 bytes; Debian: 26,401,544 bytes.
  • Windows NSIS: 23,836,608 bytes.
  • Existing signed updater assets remain .app.tar.gz + .sig on macOS, .AppImage + .sig on Linux, and NSIS .exe + .sig on Windows; latest.json remains the stable updater manifest.

PR #543 records these as final installer files without treating AppImage/deb differences as optimizer savings. No compression, updater, signing, runtime, or feature change is proposed until real per-component reports identify a safe, measurable target.

devcommented· 3 weeks ago

PR #543 is now merged normally as a0c7d430dbb3fc8910a0dfa53822c2fe6eeae595 (source head 3cf70afbca791123f30e10aec0822f6aaf1d492f).

The merged release/nightly size-evidence pipeline now:

  • Checks out the repository before running the merge script in both release and nightly publication jobs.
  • Keeps optional size-report measurement, merge, artifact upload, and release upload independent from canonical release evidence and installer publication.
  • Measures installer formats without counting detached .sig files as installer payloads, while retaining updater/signature publication unchanged.
  • Proves input files remain unchanged and contract-tests the job-scoped optional-publication behavior.

Exact PR #543 remote result before merge: CI Gate and Packaging Gate passed, branch Windows installed-app clean-install/validation passed, all Linux/macOS/Windows Rust and Tauri checks, Playwright, CodeQL, zizmor, workflow lint, dependency checks, and Kilo review passed; no failures, with only expected path-based skips. Local focused tests passed 17/17 and the full pre-push gate passed 214 files / 2,414 tests.

This closes the size-report instrumentation deliverable, but #486 remains open for the separate measured optimization/reject decisions and runtime/feature-preservation acceptance. No optimizer, updater, signing, audio, ML runtime, dictionary, or product feature was removed.

Sign in to comment.

Linked pull requests

No linked pull requests yet.