nodejs / nodejs/performance

performance of encodings (hex, base64, base64url)

Open
#128 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
399
Forks
11
Avg merge
29m
Merged PRs (30d)
1

Description

In the last few days I was investigating the performance of hex and especially base64 and base64url

Added benchmarks https://github.com/nodejs/node/pull/50348

base64 encoding is using the functionality from the base64 dependency.

base64 decoding is not using the functionality from the base64 dependency. We have a custom implementation, which handles the base64 decoding gracefully. So a whitespace does not result in an error but gets ignored.

base64url encoding is a custom implementation. So it is slower than it could be.

base64url decoding is a custom implementation. So it is slower than it could be.

hex encoding is a custom implementation. So it is slower than it could be.

hex decoding is a custom implementation. So it is slower than it could be.

Maybe this is something to be implemented in simdutf?

@lemire
@anonrig

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the benchmark changes in https://github.com/nodejs/node/pull/50348 and compare the dependency-backed base64 encoding with the custom base64url and hex implementations described here. Review whether simdutf is an appropriate direction; done should include a decided implementation path and benchmark evidence for the affected encodings.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.