Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: add fast path for Latin1 decoding #55275

Merged
merged 15 commits into from
Dec 3, 2024

Conversation

mertcanaltin
Copy link
Member

@mertcanaltin mertcanaltin commented Oct 5, 2024

I added a fast path for Latin1 (windows-1252) decoding to improve performance. This change avoids using the slower ICU-based decoding for Latin1 and instead utilizes a direct approach, similar to the fast path implemented for UTF-8.
nodejs/performance#178

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Oct 5, 2024
@mertcanaltin mertcanaltin requested review from anonrig and joyeecheung and removed request for anonrig October 5, 2024 08:45
@mertcanaltin mertcanaltin force-pushed the dev-178 branch 2 times, most recently from 2dd0714 to b871573 Compare October 5, 2024 08:50
Copy link

codecov bot commented Oct 5, 2024

Codecov Report

Attention: Patch coverage is 21.05263% with 30 lines in your changes missing coverage. Please review.

Project coverage is 88.39%. Comparing base (bbdfeeb) to head (77bc5ee).
Report is 456 commits behind head on main.

Files with missing lines Patch % Lines
src/encoding_binding.cc 10.34% 26 Missing ⚠️
lib/internal/encoding.js 55.55% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55275      +/-   ##
==========================================
- Coverage   88.41%   88.39%   -0.03%     
==========================================
  Files         652      652              
  Lines      186612   186799     +187     
  Branches    36062    36120      +58     
==========================================
+ Hits       165001   165117     +116     
- Misses      14885    14944      +59     
- Partials     6726     6738      +12     
Files with missing lines Coverage Δ
src/encoding_binding.h 100.00% <ø> (ø)
lib/internal/encoding.js 98.87% <55.55%> (-0.64%) ⬇️
src/encoding_binding.cc 71.42% <10.34%> (-12.82%) ⬇️

... and 48 files with indirect coverage changes

@anonrig
Copy link
Member

anonrig commented Oct 5, 2024

Can you update benchmarks as well?

lib/internal/encoding.js Outdated Show resolved Hide resolved
@anonrig anonrig requested review from addaleax and lemire October 5, 2024 13:28
lib/internal/encoding.js Show resolved Hide resolved
lib/internal/encoding.js Outdated Show resolved Hide resolved
lib/internal/encoding.js Outdated Show resolved Hide resolved
lib/internal/encoding.js Show resolved Hide resolved
lib/internal/encoding.js Outdated Show resolved Hide resolved
@mertcanaltin
Copy link
Member Author

mertcanaltin commented Oct 5, 2024

Can you update benchmarks as well?

I wonder if this is the right place.
benchmark/util/text-decoder.js

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 5, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 5, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mertcanaltin mertcanaltin added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Nov 21, 2024
@mertcanaltin mertcanaltin added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 25, 2024
@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Dec 3, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 3, 2024
@nodejs-github-bot nodejs-github-bot merged commit 20bcaa0 into nodejs:main Dec 3, 2024
76 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 20bcaa0

aduh95 pushed a commit to aduh95/node that referenced this pull request Dec 4, 2024
PR-URL: nodejs#55275
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
aduh95 pushed a commit to aduh95/node that referenced this pull request Dec 4, 2024
PR-URL: nodejs#55275
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
targos pushed a commit that referenced this pull request Dec 6, 2024
PR-URL: #55275
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
@aduh95 aduh95 added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. and removed dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Dec 11, 2024
ruyadorno pushed a commit that referenced this pull request Dec 20, 2024
PR-URL: #55275
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
ruyadorno pushed a commit that referenced this pull request Jan 5, 2025
PR-URL: #55275
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants