Skip to content

perf: use less promises in extractBody#4458

Merged
Uzlopak merged 1 commit intomainfrom
perf-extract-body
Sep 18, 2025
Merged

perf: use less promises in extractBody#4458
Uzlopak merged 1 commit intomainfrom
perf-extract-body

Conversation

@Uzlopak
Copy link
Copy Markdown
Contributor

@Uzlopak Uzlopak commented Aug 24, 2025

This relates to...

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

Copy link
Copy Markdown
Member

@KhafraDev KhafraDev left a comment

Choose a reason for hiding this comment

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

@Uzlopak
Copy link
Copy Markdown
Contributor Author

Uzlopak commented Aug 25, 2025

See my answer to your linked comment.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

lgtm

@Uzlopak Uzlopak requested a review from Copilot September 6, 2025 06:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves performance in the extractBody function by reducing the use of async/await syntax in favor of explicit promise handling.

  • Removes async/await from ReadableStream controller methods
  • Converts async functions to return promises directly using .then()
  • Simplifies promise handling in iterator operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lib/web/fetch/body.js
Comment thread lib/web/fetch/body.js
@Uzlopak Uzlopak requested a review from KhafraDev September 12, 2025 22:07
@Uzlopak Uzlopak dismissed KhafraDev’s stale review September 12, 2025 22:08

It was condition by Khafra, that he has no objection if i remove the promise counting test. I removed it. No revew till now.

@Uzlopak Uzlopak merged commit 5b55d88 into main Sep 18, 2025
36 checks passed
@Uzlopak Uzlopak deleted the perf-extract-body branch September 18, 2025 13:23
@github-actions github-actions Bot mentioned this pull request Jan 5, 2026
slagiewka pushed a commit to slagiewka/undici that referenced this pull request Feb 14, 2026
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.

5 participants