Skip to content

Conversation

@Tina-1300
Copy link

This PR replaces the existing Base64Decode implementation with a more optimized version :

  • Pre-allocates the output string to avoid dynamic reallocations.
  • Decodes 4 Base64 characters into 3 bytes per iteration.
  • Branchless main loop for better CPU performance.
  • Handles padding '=' efficiently after the main loop.
  • Uses a static lookup table initialized once, reducing overhead on repeated calls.

Performance improvements are noticeable for large Base64 inputs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant