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
Copy file name to clipboardExpand all lines: .jules/bolt.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,3 +99,6 @@
99
99
## 2026-05-25 - O(N*C^2) mapping optimization in TableActions paste operation
100
100
**Learning:** Found an $O(N \times C^2)$ performance bottleneck in `web/src/components/node/DataTable/TableActions.tsx` when pasting large sets of data into the DataTable. For every column in every row, the code looped over `columnMapping.entries()` (which is size $C$) to find the corresponding paste column index.
101
101
**Action:** Replaced the paste column index lookup via `Map.entries()` iteration with a pre-computed `$O(1)$` lookup. By inverting the map from `columnMapping` to `dfIdxToPasteIdx` (mapping dataframe column index to pasted index), the time complexity of pasting data is reduced to $O(N \times C)$.
102
+
## 2026-05-25 - N+1 query optimization in pruneOldAutosaves
103
+
**Learning:** Found an N+1 query bottleneck in `packages/models/src/workflow-version.ts` where `v.delete()` was called inside a loop over the oldest autosave versions. For workflows with many excess autosaves (e.g. 1500), doing 1500 sequential `DELETE` queries took ~392ms.
104
+
**Action:** Replaced the sequential deletes with batched `DELETE WHERE id IN (...)` queries (using `inArray` from Drizzle) grouped in chunks of 500 to satisfy SQLite query limits. This reduced the time to prune 1500 versions to ~18ms, a significant speedup.
0 commit comments