Skip to content

Conversation

@semimikoh
Copy link
Contributor

@semimikoh semimikoh commented Nov 24, 2025

The benchmark for Buffer.byteLength with encoding === 'base64' does not
return a Base64-encoded string. getInput() discards the encoded value and
returns the original UTF-8 string, causing the benchmark to run against
non-base64 input.

This patch ensures that when encoding === 'base64', the function returns the
actual Base64-encoded string.

This brings the benchmark in line with its expected behavior and makes the
results meaningful.

This fixes the benchmark issue reported in #60836.

Fixes: #60836

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. buffer Issues and PRs related to the buffer subsystem. labels Nov 24, 2025
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Dec 3, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 3, 2025
@nodejs-github-bot nodejs-github-bot merged commit 470ef98 into nodejs:main Dec 3, 2025
40 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 470ef98

targos pushed a commit that referenced this pull request Dec 5, 2025
PR-URL: #60841
Fixes: #60836
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
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. benchmark Issues and PRs related to the benchmark subsystem. buffer Issues and PRs related to the buffer subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer.byteLength benchmark does not test base64 encoding correctly

6 participants