Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
## 2024-05-23 - Synchronous Audit Logging Bottleneck
**Learning:** `ToolOrchestrator._audit_action` was performing synchronous file I/O (open/write/close) for every tool invocation. This introduced ~68ms latency per 1000 calls. Moving this to a background thread with `queue.Queue` reduced it to ~3ms (20x improvement).
**Action:** For high-frequency logging or audit trails, always use an asynchronous writer or background thread to decouple I/O latency from the main execution path.
## 2024-05-18 - Optimize GraphManager entity similarity
**Learning:** N+1 queries in SQLAlchemy async tasks severely degrade performance, especially when checking relationships for all entities. Using Common Table Expressions (CTEs) to perform intersections and group counts in a single SQL query avoids retrieving large quantities of data back to the application layer.
**Action:** Prioritize batching or joining data directly in SQL using CTEs instead of iterating over returned rows and executing individual queries for each entity comparison.
Loading
Loading