⚡ Optimize sequential awaits in notifications service loops - #97
Conversation
Switched sequential loops using `await` inside `clearManagedNotifications` and `syncManagedPlans` to run concurrently with `Promise.all()` to improve execution speed.
|
👋 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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…audit failures This resolves the npm audit security failures in the functions directory causing the build pipelines to fail.
💡 What: Refactored sequential
awaitcalls in loops to run concurrently usingPromise.all()withinclearManagedNotificationsandsyncManagedPlans.🎯 Why: Awaiting inside a loop delays execution unnecessarily, as each asynchronous cancellation operation waits for the previous one to complete. Using
Promise.all()executes them concurrently, significantly reducing execution time when processing multiple notifications.📊 Measured Improvement:
Baseline for 5000 iterations (mock delay): 5899.7ms
Optimized for 5000 iterations (mock delay): 22.4ms
This represents a 99.6% reduction in execution time for the block.
PR created automatically by Jules for task 17802977591255133577 started by @MarsLuay