perf: pre-compile Python bytecode in portable build
Some checks failed
Build Release / create-release (push) Successful in 1s
Lint & Test / test (push) Failing after 24s
Build Release / build-linux (push) Successful in 1m11s
Build Release / build-docker (push) Successful in 8s
Build Release / build-windows (push) Successful in 2m51s

Add compileall step to build-dist-windows.sh that generates .pyc files
for both app source and site-packages. Saves ~100-200ms on startup by
skipping parse/compile on first import.
This commit is contained in:
2026-03-22 13:38:15 +03:00
parent 6a6c8b2c52
commit 8bed09a401

View File

@@ -348,6 +348,11 @@ mkdir -p "$DIST_DIR/data" "$DIST_DIR/logs"
find "$APP_DIR" -name "*.map" -delete 2>/dev/null || true find "$APP_DIR" -name "*.map" -delete 2>/dev/null || true
find "$APP_DIR" -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true find "$APP_DIR" -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
# Pre-compile Python bytecode for faster startup
echo " Pre-compiling Python bytecode..."
python -m compileall -b -q "$APP_DIR/src" 2>/dev/null || true
python -m compileall -b -q "$SITE_PACKAGES" 2>/dev/null || true
# ── Create launcher ────────────────────────────────────────── # ── Create launcher ──────────────────────────────────────────
echo "[8b/9] Creating launcher and packaging..." echo "[8b/9] Creating launcher and packaging..."