Skip to content

⚡ Optimize sequential awaits in notifications service loops - #97

Merged
MarsLuay merged 2 commits into
mainfrom
optimize-notifications-17802977591255133577
Sep 10, 2026
Merged

⚡ Optimize sequential awaits in notifications service loops#97
MarsLuay merged 2 commits into
mainfrom
optimize-notifications-17802977591255133577

Conversation

@MarsLuay

@MarsLuay MarsLuay commented Sep 9, 2026

Copy link
Copy Markdown
Owner

💡 What: Refactored sequential await calls in loops to run concurrently using Promise.all() within clearManagedNotifications and syncManagedPlans.
🎯 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

Switched sequential loops using `await` inside `clearManagedNotifications` and `syncManagedPlans` to run concurrently with `Promise.all()` to improve execution speed.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings September 9, 2026 21:17
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cheapest-flight-picker Ready Ready Preview Sep 9, 2026 9:54pm UTC
gator-guide Ready Ready Preview Sep 9, 2026 9:54pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…audit failures

This resolves the npm audit security failures in the functions directory causing the build pipelines to fail.
@MarsLuay
MarsLuay merged commit 0ae2a42 into main Sep 10, 2026
11 of 13 checks passed
@MarsLuay
MarsLuay deleted the optimize-notifications-17802977591255133577 branch September 10, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants