Skip to content

Conversation

@RafaelGSS
Copy link
Member

as titled

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. querystring Issues and PRs related to the built-in querystring module. labels Nov 1, 2025
@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.56%. Comparing base (3e31bae) to head (9114a30).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60522      +/-   ##
==========================================
+ Coverage   88.55%   88.56%   +0.01%     
==========================================
  Files         704      704              
  Lines      207824   207825       +1     
  Branches    40042    40033       -9     
==========================================
+ Hits       184036   184059      +23     
+ Misses      15835    15804      -31     
- Partials     7953     7962       +9     
Files with missing lines Coverage Δ
lib/querystring.js 100.00% <100.00%> (ø)

... and 31 files with indirect coverage changes

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

@Hritikk999

This comment was marked as off-topic.

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

Is there any point? length is not a getter, accessing it directly is probably cheaper than declaring a variable, no?

@RafaelGSS
Copy link
Member Author

Is there any point? length is not a getter, accessing it directly is probably cheaper than declaring a variable, no?

I was doing some tests yesterday, and my local benchmark has shown that object property access has a cost (possibly hidden classes?).

But, turns out my local benchmark was being affected by something else, I re-ran my analysis today and there's no difference/improvement on my PR. Closing.

@RafaelGSS RafaelGSS closed this Nov 1, 2025
@ChALkeR
Copy link
Member

ChALkeR commented Nov 2, 2025

Ah. I thought this was just for code style

This code is almost never called under normal usage

I.e. sep or eq have to set and multi-byte for this
And, unless sep or eq are somehow long, this would be just a few calls

@ChALkeR
Copy link
Member

ChALkeR commented Nov 2, 2025

Instead you might want to replace

  const sepCodes = (!sep ? defSepCodes : charCodes(String(sep)));
  const eqCodes = (!eq ? defEqCodes : charCodes(String(eq)));

with

  const sepCodes = ((!sep || sep === '&') ? defSepCodes : charCodes(String(sep)));
  const eqCodes = ((!eq || eq === '=') ? defEqCodes : charCodes(String(eq)));

if that would have any observable effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. querystring Issues and PRs related to the built-in querystring module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants