Skip to content

Revert "perf: reuse TextDecoder instance (#2863)"#2999

Merged
ronag merged 1 commit into
nodejs:mainfrom
panva:revert-decoder
Mar 27, 2024
Merged

Revert "perf: reuse TextDecoder instance (#2863)"#2999
ronag merged 1 commit into
nodejs:mainfrom
panva:revert-decoder

Conversation

@panva

@panva panva commented Mar 27, 2024

Copy link
Copy Markdown
Member

@codecov-commenter

codecov-commenter commented Mar 27, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.50%. Comparing base (ef25209) to head (230b784).
⚠️ Report is 979 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2999      +/-   ##
==========================================
- Coverage   93.50%   93.50%   -0.01%     
==========================================
  Files          89       89              
  Lines       24223    24220       -3     
==========================================
- Hits        22649    22646       -3     
  Misses       1574     1574              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ronag ronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACtually doesn't this just move the issue to when websocket is used? Should we maybe not pass fatal? Does the spec require that? If it does, then maybe we should disable websocket for builds without ICU?

@ronag
ronag requested a review from KhafraDev March 27, 2024 08:07

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@panva

panva commented Mar 27, 2024

Copy link
Copy Markdown
Member Author

ACtually doesn't this just move the issue to when websocket is used? Should we maybe not pass fatal? Does the spec require that? If it does, then maybe we should disable websocket for builds without ICU?

I don't particularly care how this moves forward but the revert is needed to unblock a Node.js version bump.

@Uzlopak Uzlopak 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.

It actually revealed that there is an issue with no-icu cases.

@panva

panva commented Mar 27, 2024

Copy link
Copy Markdown
Member Author

It actually revealed that there is an issue with no-icu cases.

Which, now that we know about it, we can take all the time in the world to contemplate a fix for. In the meantime, node's bundled fetch is lagging behind on fixes which is why this revert is proposed.

@Uzlopak

Uzlopak commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

I would atleast expect that you open an issue here, so that it keeps tracked.

@Uzlopak Uzlopak 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.

Approving but somebody should create an issue.

@ronag
ronag merged commit 0ac82a0 into nodejs:main Mar 27, 2024
@panva

panva commented Mar 27, 2024

Copy link
Copy Markdown
Member Author

I would atleast expect that you open an issue here, so that it keeps tracked.

Noted.

#3002

@panva
panva deleted the revert-decoder branch March 27, 2024 09:16
@panva

panva commented Mar 27, 2024

Copy link
Copy Markdown
Member Author

@mcollina can you do a release? Node nightly is currently lagging on 6.6.2

@ronag

ronag commented Mar 27, 2024

Copy link
Copy Markdown
Member

6.10.2 published

@KhafraDev

Copy link
Copy Markdown
Member

Does the spec require that?

yes, we're meant to close the connection if we receive invalid utf-8

If it does, then maybe we should disable websocket for builds without ICU?

It actually revealed that there is an issue with no-icu cases.

It's already essentially disabled:

  • Open a WebSocket connection (on a build without icu)
  • The connection closes if it receives a message.
  • The close frame has no reason if we receive a close frame.

We might be able to support builds without icu by using Buffer.isUTF8, but it should only be used when we can't use TextDecoder for perf. I'm not really sure if it's available in builds without ICU and I don't have the time to test myself.

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.

7 participants