Skip to content

dns: reserve vector capacity in ParseTxtReply - #64978

Open
agape1225 wants to merge 1 commit into
nodejs:mainfrom
agape1225:dns-reserve-txt-chunks
Open

dns: reserve vector capacity in ParseTxtReply#64978
agape1225 wants to merge 1 commit into
nodejs:mainfrom
agape1225:dns-reserve-txt-chunks

Conversation

@agape1225

Copy link
Copy Markdown
Contributor

The chunks vector's upper bound is known before the loop starts (str_count from ares_dns_rr_get_abin_cnt), so reserve the capacity upfront to avoid unnecessary reallocations.

The chunks vector's upper bound is known before the loop starts
(str_count from ares_dns_rr_get_abin_cnt), so reserve the capacity
upfront to avoid unnecessary reallocations.

Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run. labels Aug 3, 2026
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (219dbd6) to head (4090b9d).
⚠️ Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64978      +/-   ##
==========================================
+ Coverage   90.27%   90.28%   +0.01%     
==========================================
  Files         762      762              
  Lines      247524   247525       +1     
  Branches    46693    46692       -1     
==========================================
+ Hits       223451   223486      +35     
+ Misses      15494    15487       -7     
+ Partials     8579     8552      -27     
Files with missing lines Coverage Δ
src/cares_wrap.cc 62.95% <100.00%> (+0.02%) ⬆️

... and 34 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.

@daeyeon daeyeon added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 4, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants