Repository navigation
Conversation
💡 What: Replaced a heavy chain of `.map()`, array spreading, `new Set()`, `Array.from()`, and `.slice()` with bounded `for` loops in the backtest runner. 🎯 Why: High-frequency backtesting engines suffer when allocating large intermediate arrays inside hot loops, creating significant garbage collection (GC) overhead. 📊 Impact: Eliminates three intermediate array allocations and truncates iteration early if the max candidate count is reached, saving memory overhead in each step of the backtest loop. 🔬 Measurement: Verify via backtest run performance and `pnpm test`. Co-authored-by: toreleon <42534763+toreleon@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Closed in favor of #173. |
💡 What: Replaced a heavy functional pipeline (chain of
.map(), array spreading,new Set(),Array.from(), and.slice()) with boundedforloops and an early-exitSetduring candidate deduplication in the backtest runner.🎯 Why: High-frequency backtesting engines suffer when allocating large intermediate arrays inside hot loops. This process was needlessly spreading entire sets of positions and candidates into temporary arrays just to slice a tiny subset off the end.
📊 Impact: Eliminates three intermediate array allocations per iteration and stops looping once the required
maxCandidatesthreshold is met, reducing GC overhead and memory churn.🔬 Measurement: Verify by running the test suite (
pnpm test) and observing backtest speed.PR created automatically by Jules for task 11300147719612583135 started by @toreleon