Skip to content

Commit f9d2b98

Browse files
committed
v1.9.25: cache /system/dependencies (5s → 0ms, ~6000x speedup)
Caught during the v1.9.24 binary smoke test: /system/dependencies took ~6.5s on the first cold call because it runs 20+ importlib.import_module() probes (torch, mediapipe, audiocraft, pyannote, onnxruntime, rembg, realesrgan, gfpgan, insightface, ...) plus an ffmpeg -version subprocess plus an ollama HTTP probe — all synchronously in one request. This blocked the Settings tab render on first open. Fix: module-level _deps_cache with threading.Lock + 60-second TTL in routes/system.py. Cold call still pays the ~5s import tax once; every subsequent call within the window returns from memory in <1ms. Measured: cold call: 6463 ms warm call: 0 ms (~6000x speedup) fresh=1: 22 ms (bypasses cache) New ?fresh=1 query param lets the frontend force a re-check after an install/uninstall finishes.
1 parent 93b86be commit f9d2b98

19 files changed

Lines changed: 50 additions & 21 deletions

File tree

CLAUDE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
- Lint: `ruff check opencut/` — codebase is fully clean, pre-commit enforces on every commit
182182

183183
## Version
184-
- Current: **v1.9.24**
184+
- Current: **v1.9.25**
185185
- All version strings: `pyproject.toml`, `__init__.py`, `CSXS/manifest.xml` (ExtensionBundleVersion + Version), `com.opencut.uxp/manifest.json`, `com.opencut.uxp/main.js` (VERSION const), `index.html` version display, README badge, `package.json`
186186
- Use `python scripts/sync_version.py --set X.Y.Z` to update all 19 targets at once (including UXP files and package.json)
187187
- Use `python scripts/sync_version.py --check` in CI to verify all targets match
@@ -1067,6 +1067,13 @@ Comprehensive multi-phase audit across all 138 files (~82,500 lines). 103 issues
10671067
- **4 new UXP Video features** — AI Upscale, Scene Detection, Style Transfer, Shorts Pipeline. Full HTML cards + JS handlers with job polling.
10681068
- **UXP stale version fixed** — Settings showed "1.9.2" hardcoded. Now synced via version script.
10691069

1070+
## v1.9.25 `/system/dependencies` TTL cache (5s → 0ms)
1071+
Caught during the v1.9.24 binary smoke test: `/system/dependencies` took ~6.5 s on the first cold call because it runs 20+ `importlib.import_module()` probes (torch, mediapipe, audiocraft, pyannote, onnxruntime, rembg, realesrgan, gfpgan, insightface, ...) plus an `ffmpeg -version` subprocess plus an ollama HTTP probe — all synchronously in one request. This blocks the Settings tab render on first open.
1072+
1073+
- Added a module-level `_deps_cache = {"data": None, "ts": 0.0}` + `threading.Lock` in `routes/system.py` with a 60-second TTL. Cold call still pays the ~5 s import tax once; every subsequent call within the window returns from memory in <1 ms.
1074+
- Cold call: 6463 ms. Warm call: 0 ms. **~6000× speedup.**
1075+
- New `?fresh=1` query param bypasses the cache when the frontend wants a forced re-check after an install/uninstall.
1076+
10701077
## v1.9.24 Env-var config (`OPENCUT_PORT` / `OPENCUT_HOST` / `OPENCUT_DEBUG`)
10711078
Found during a binary smoke test — `OPENCUT_PORT=5789 ./OpenCut-Server.exe` silently ignored the env var and always bound to 5679. CLAUDE.md had long advertised env-based config, but `opencut/server.py::main()` only read `argparse` flags with hardcoded defaults. Fixed so that:
10721079
- `OPENCUT_HOST` (default `127.0.0.1`)

Install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Write-Host " \___/| .__/ \___|_| |_|\____\__,_|\__|" -ForegroundColor Cyan
155155
Write-Host " |_| " -ForegroundColor Cyan
156156
Write-Host ""
157157
Write-Host " Open Source Video Editing Automation" -ForegroundColor DarkGray
158-
Write-Host " Installer v1.9.24" -ForegroundColor DarkGray
158+
Write-Host " Installer v1.9.25" -ForegroundColor DarkGray
159159

160160
$isAdmin = Test-IsAdmin
161161
if ($isAdmin) {

OpenCut.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; Fully self-contained installer — bundles server exe, ffmpeg, and CEP extension
33

44
#define MyAppName "OpenCut"
5-
#define MyAppVersion "1.9.24"
5+
#define MyAppVersion "1.9.25"
66
#define MyAppPublisher "SysAdminDoc"
77
#define MyAppURL "https://github.com/SysAdminDoc/OpenCut"
88

extension/com.opencut.panel/CSXS/manifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
Version="7.0"
44
ExtensionBundleId="com.opencut.panel"
5-
ExtensionBundleVersion="1.9.24"
5+
ExtensionBundleVersion="1.9.25"
66
ExtensionBundleName="OpenCut">
77

88
<ExtensionList>
9-
<Extension Id="com.opencut.panel.main" Version="1.9.24" />
9+
<Extension Id="com.opencut.panel.main" Version="1.9.25" />
1010
</ExtensionList>
1111

1212
<ExecutionEnvironment>

extension/com.opencut.panel/client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3524,7 +3524,7 @@ <h3 class="media-sidecar-title">No media in the workspace yet.</h3>
35243524
<div class="card-header"><div class="card-title" data-i18n="settings.about">About OpenCut</div></div>
35253525
<div class="settings-row">
35263526
<span class="settings-label">Version</span>
3527-
<span class="settings-value">1.9.24</span>
3527+
<span class="settings-value">1.9.25</span>
35283528
</div>
35293529
<div class="about-links">
35303530
<a href="https://github.com/SysAdminDoc/opencut" class="about-link" target="_blank">GitHub</a>

extension/com.opencut.panel/client/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ============================================================
2-
OpenCut CEP Panel - Main Controller v1.9.24
2+
OpenCut CEP Panel - Main Controller v1.9.25
33
6-Tab Professional Toolkit
44
============================================================ */
55
(function () {

extension/com.opencut.panel/client/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ============================================================
2-
OpenCut CEP Panel v1.9.24 - ULTRA PREMIUM EDITION
2+
OpenCut CEP Panel v1.9.25 - ULTRA PREMIUM EDITION
33
Next-Generation AI Editing Suite for Adobe Premiere Pro
44
============================================================ */
55

extension/com.opencut.panel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencut-panel",
3-
"version": "1.9.24",
3+
"version": "1.9.25",
44
"private": true,
55
"description": "OpenCut CEP Panel for Adobe Premiere Pro",
66
"scripts": {

extension/com.opencut.uxp/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<path d="M4 2.5a3 3 0 00-1.76 5.43L7.33 11l-5.09 3.07A3 3 0 104.8 19.5a3 3 0 001.76-5.43L8.93 12.6 16.5 17V5L8.93 9.4 6.56 7.93A3 3 0 004 2.5z" fill="var(--accent)"/>
1717
</svg>
1818
<span class="oc-logo">OpenCut</span>
19-
<span class="oc-version">v1.9.24</span>
19+
<span class="oc-version">v1.9.25</span>
2020
</div>
2121
<div class="oc-header-right">
2222
<div class="oc-connection" id="connectionStatus" title="Backend connection status">

extension/com.opencut.uxp/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const HEALTH_CHECK_MS = 8000;
2626
const HEALTH_MAX_MS = 60000;
2727
const MEDIA_SCAN_MS = 30000;
2828
const SSE_AVAILABLE = typeof EventSource !== "undefined";
29-
const VERSION = "1.9.24";
29+
const VERSION = "1.9.25";
3030

3131
async function detectBackend() {
3232
// Try ports 5679-5689 like CEP panel does

0 commit comments

Comments
 (0)