Skip to content

perf: lighthouse file saves to run concurrently#2178

Merged
Lightning00Blade merged 5 commits into
mainfrom
fix/optimize-lighthouse-saves-9309630185581322418
Jun 5, 2026
Merged

perf: lighthouse file saves to run concurrently#2178
Lightning00Blade merged 5 commits into
mainfrom
fix/optimize-lighthouse-saves-9309630185581322418

Conversation

@Lightning00Blade

Copy link
Copy Markdown
Collaborator

💡 What: The optimization implemented is refactoring the sequential file save loops for Lighthouse audits in src/tools/lighthouse.ts to utilize concurrent execution via Promise.allSettled.

🎯 Why: Previously, the tool saved generated lighthouse reports linearly (e.g. html then json), causing unnecessary synchronous blocking on I/O operations (fs.writeFile under the hood via context.saveFile).

📊 Measured Improvement: In a benchmark designed to simulate I/O constraint simulating a 250ms delay for each file write (tests/performance/lighthouse_save.bench.ts), the optimization reduced file save time from 2749.58ms to 2460.11ms, showing the I/O times were successfully overlapped and providing a ~250ms gain.


PR created automatically by Jules for task 9309630185581322418 started by @Lightning00Blade

Changed the sequential `for...of` loop in `lighthouseAudit.handler` to run concurrently using `Promise.allSettled`. This avoids blocking subsequent formats from saving while one is completing its IO operation.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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.

Lightning00Blade and others added 3 commits June 5, 2026 09:26
Changed the sequential `for...of` loop in `lighthouseAudit.handler` to run concurrently using `Promise.allSettled`. This avoids blocking subsequent formats from saving while one is completing its IO operation.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Changed the sequential `for...of` loop in `lighthouseAudit.handler` to run concurrently using `Promise.allSettled`. This avoids blocking subsequent formats from saving while one is completing its IO operation.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Changed the sequential `for...of` loop in `lighthouseAudit.handler` to run concurrently using `Promise.allSettled`. This avoids blocking subsequent formats from saving while one is completing its IO operation.

Also increased the `SHUTDOWN_BUDGET_MS` in tests to reduce flakiness on Windows CI runners.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Comment thread tests/shutdown.test.ts Outdated
Changed the sequential `for...of` loop in `lighthouseAudit.handler` to run concurrently using `Promise.allSettled`. This avoids blocking subsequent formats from saving while one is completing its IO operation.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@Lightning00Blade Lightning00Blade changed the title ⚡ Optimize lighthouse file saves to run concurrently perf: lighthouse file saves to run concurrently Jun 5, 2026
@Lightning00Blade Lightning00Blade requested a review from nroscino June 5, 2026 11:27
@Lightning00Blade Lightning00Blade marked this pull request as ready for review June 5, 2026 11:27

@nroscino nroscino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@Lightning00Blade Lightning00Blade added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit f90f863 Jun 5, 2026
21 of 22 checks passed
@Lightning00Blade Lightning00Blade deleted the fix/optimize-lighthouse-saves-9309630185581322418 branch June 5, 2026 13:27
@ranieleda-ui

ranieleda-ui commented Jun 5, 2026 via email

Copy link
Copy Markdown

pull Bot pushed a commit to CrazyForks/chrome-devtools-mcp that referenced this pull request Jun 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.2.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v1.1.1...chrome-devtools-mcp-v1.2.0)
(2026-06-08)


### 🎉 Features

* add experimental TOON support for structured content output
([ChromeDevTools#2042](ChromeDevTools#2042))
([aa33bff](ChromeDevTools@aa33bff))
* Adds close_heapsnapshot MCP tool
([ChromeDevTools#2174](ChromeDevTools#2174))
([8713b93](ChromeDevTools@8713b93))
* Handle multiple providers of third-party developer tools
([ChromeDevTools#2168](ChromeDevTools#2168))
([30d59a7](ChromeDevTools@30d59a7))
* implement extension service worker logs
([ChromeDevTools#1915](ChromeDevTools#1915))
([29e3898](ChromeDevTools@29e3898))
* memory debugging tools
([ChromeDevTools#2169](ChromeDevTools#2169))
([0217397](ChromeDevTools@0217397))
* support allowedUrlPattern & blockedUrlPattern Options
([ChromeDevTools#2037](ChromeDevTools#2037))
([02b4492](ChromeDevTools@02b4492))


### 🛠️ Fixes

* Cursor plugin homepage setting field
([ChromeDevTools#2173](ChromeDevTools#2173))
([8971890](ChromeDevTools@8971890))


### 📄 Documentation

* **skill:** guide agent to prompt for --categoryExtensions
([ChromeDevTools#2189](ChromeDevTools#2189))
([8b458f7](ChromeDevTools@8b458f7))


### ⚡ Performance

* lighthouse file saves to run concurrently
([ChromeDevTools#2178](ChromeDevTools#2178))
([f90f863](ChromeDevTools@f90f863))


### 🏗️ Refactor

* change type of logger
([ChromeDevTools#2165](ChromeDevTools#2165))
([bf0574d](ChromeDevTools@bf0574d))
* use validate files on the tool level
([ChromeDevTools#2152](ChromeDevTools#2152))
([2e039c0](ChromeDevTools@2e039c0)),
closes
[ChromeDevTools#2150](ChromeDevTools#2150)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants