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
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:
@@ -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" -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 ──────────────────────────────────────────
|
||||
|
||||
echo "[8b/9] Creating launcher and packaging..."
|
||||
|
||||
Reference in New Issue
Block a user