Skip to content

feat: Performance boost with Promise.all concurrency 🚀 - #40212

Open
sanjaiyan-dev wants to merge 2 commits into
ampproject:mainfrom
sanjaiyan-dev:sanjaiyan-async-parallel
Open

feat: Performance boost with Promise.all concurrency 🚀#40212
sanjaiyan-dev wants to merge 2 commits into
ampproject:mainfrom
sanjaiyan-dev:sanjaiyan-async-parallel

Conversation

@sanjaiyan-dev

Copy link
Copy Markdown

This PR improves performance by switching to concurrent execution of asynchronous operations using Promise.all. Previously, these operations were sequential, increasing processing time.

Promise.all allows multiple promises to resolve concurrently, significantly reducing the overall execution time when dealing with independent asynchronous tasks. This is especially beneficial when I/O bound operations are involved, as the CPU can work on other tasks while waiting for responses.

Extremely sorry if I made any mistakes.

@CLAassistant

CLAassistant commented Dec 26, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@erwinmombay

Copy link
Copy Markdown
Member

heya looks like the build is broken because of a chrome issue that we are currently trying to resolve. once it is fixed, we'll need to rebase this. I'll ping this thread once we've merged the workaround.

@erwinmombay

Copy link
Copy Markdown
Member

the issue has been temporarily resolved thru #39912 . Please rebase this PR and ping me when ready.

Thank for for submitting this optimization!

@sanjaiyan-dev
sanjaiyan-dev force-pushed the sanjaiyan-async-parallel branch from 8428b9f to 7483440 Compare September 3, 2026 15:57
@sanjaiyan-dev

Copy link
Copy Markdown
Author

@erwinmombay Really sorry for the delay! The PR has now been cleanly rebased onto the latest main and the CLA is signed. Ready for review whenever you have a moment. Thank you :)

@danielrozenberg

Copy link
Copy Markdown
Member

I tested running amp dist several times with/without this PR. Unfortunately I'm not seeing any performance improvements. Are you seeing different numbers than me?

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.

4 participants