Skip to content

perf(encoding): improve hex encode/decode performance #6499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2025

Conversation

BlackAsLight
Copy link
Contributor

This pull request brings the performance added in #6480 to the stable hex functions, but in a non-breaking manner. The only difference a user would find is a difference in error message if providing an invalid encoded string.

@BlackAsLight BlackAsLight requested a review from kt3k as a code owner March 20, 2025 05:11
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.30%. Comparing base (48fae8f) to head (3e1e8d2).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6499      +/-   ##
==========================================
- Coverage   95.30%   95.30%   -0.01%     
==========================================
  Files         575      575              
  Lines       43279    43258      -21     
  Branches     6467     6461       -6     
==========================================
- Hits        41247    41226      -21     
  Misses       1993     1993              
  Partials       39       39              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Note: This change includes the change of priority of errors when the decode input has 2 errors (invalid chars and invalid length). I believe this doesn't affect the users' code in a significant manner.

@kt3k kt3k merged commit fa656d0 into denoland:main Mar 24, 2025
18 checks passed
@BlackAsLight BlackAsLight deleted the encoding_stable_hex branch March 24, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants