You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(catalog): O(1) unit name lookups + source-build progress
`refresh catalog source` resolved each document by re-reading and
re-bson.Unmarshalling every unit on every describe call (GetRawUnitByName /
GetRawMicroflowByName scanned the full unit list per call). With one describe per
document, that's O(N²) — ~6 hours on a large app (#651).
Fix: the reader builds a one-time index keyed by "$Type\x00QualifiedName" → unit,
decoding only the Name field (a small struct, far cheaper than map[string]any).
Lookups become O(1); the catalog's parallel describe shares one backend, so the
index is built once and reused. Invalidated by InvalidateCache after writes.
Also: buildSource Phase 2 reports incremental progress every 2s (was silent for
the whole multi-minute/hour build — the #651 "no progress" complaint).
Verified: GraphViewer source build (993 microflows) ~3.5min with live progress;
the O(N²) (993² unmarshals ≈ 80min for microflows alone) is gone.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
18
18
19
19
### Fixed
20
20
21
+
-**`refresh catalog source` no longer O(N²) on large projects** — it resolved each document by re-reading and re-`bson.Unmarshal`ing *every* unit on *every* describe call, so a big app (#651: ~3.3k microflows, ~33k activities) took ~6 hours. The reader now builds a one-time `$Type + qualified-name → unit` index (decoding only the `Name` field, not the whole document), making `GetRawUnitByName` / `GetRawMicroflowByName` O(1); the shared backend means the index is built once across the parallel describe workers. The source phase also reports incremental progress every 2s instead of going silent for the whole build. GraphViewer's source build (993 microflows) dropped to ~3.5 min with live progress; cloud-portal-scale projects go from hours to minutes
21
22
-**Marketplace search now scans the whole catalog** — the Content API has no server-side search and caps `limit` at 100 per page, so `marketplace search` previously only filtered the first 100 items and silently missed matches further in (e.g. External Database Connector `219862`, Mendix Business Events `202649`). It now paginates via `offset`, fetching pages **concurrently** (first page alone so a common early match stays a single request; then bounded-parallel batches), and stops at `--limit` matches or end-of-catalog. Measured ~3m45s → ~44s on a slow link for a deep match; combined with the new cache, repeat searches are instant
0 commit comments