Skip to content
Draft
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
@@ -0,0 +1,3 @@
## 2026-06-20 - O(log N) Time-Series Market Data Lookups
**Learning:** During historical simulation in `backtestRunner`, filtering arrays of chronologically sorted market data bars via `Array.prototype.filter` to clip bars against an advancing 'as-of' time results in O(N) iterations and memory allocations inside internal backtest loops.
**Action:** Exploit the strictly chronological (sorted) invariant of time-series market data arrays. Use binary search (via a shared `findLastBarIndex` utility) to slice or access O(1) matching elements, achieving O(log N) lookup time without intermediate array allocations for price and index retrievals in the inner loop of the backtesting engine.
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,28 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
"better-sqlite3": "^11.5.0",
"@anthropic-ai/claude-agent-sdk": "^0.1.77",
"better-sqlite3": "^11.10.0",
"cheerio": "^1.0.0",
"ink": "^5.0.1",
"ink": "^5.2.1",
"ink-spinner": "^5.0.0",
"ink-text-input": "^6.0.0",
"react": "^18.3.1",
"technicalindicators": "^3.1.0",
"undici": "^6.20.0",
"yaml": "^2.6.0",
"zod": "^3.23.8"
"undici": "^7.28.0",
"ws": "^8.21.0",
"yaml": "^2.9.0",
"zod": "^3.25.76"
},
"devDependencies": {
"@changesets/cli": "^2.31.0",
"@types/better-sqlite3": "^7.6.11",
"@types/node": "^22.7.0",
"@types/react": "^18.3.12",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^22.20.0",
"@types/react": "^18.3.31",
"ink-testing-library": "^4.0.0",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
"tsx": "^4.22.4",
"typescript": "^5.9.3",
"vitest": "^2.1.9"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
Loading
Loading