Skip to content

Conversation

@semimikoh
Copy link

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

4 participants