Skip to content
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

common/hexutil: use assembly hex encoder on amd64 #30075

Closed
wants to merge 1 commit into from

Conversation

karalabe
Copy link
Member

@karalabe karalabe commented Jun 26, 2024

This PR vendors in the crux of https://github.com/tmthrgd/go-hex.

The reason the lib cannot be used as a dependency is because it redefines the error types from hex with a different message (whyy) and one of the errors is private, so it cannot be matched against.

I deleted most stuff and only left the main encoder and decoder in place, redirected the errors to use the stdlib hex errors, and I've replaced the "generic" encoder included in the lib with the stdlib one (faster).


If we get somewhere meaningful, we might consider upstreaming it via golang/go#68188, though I'm not seeing too big of an appreciation for it.

@karalabe karalabe requested review from fjl and gballet June 26, 2024 19:59
@karalabe
Copy link
Member Author

Nuking this effort. JSON remains very slow on literal string output due to forced escaping whether we like it or not, so it doesn't make too much sense to make hex fast if json will eat up the improvements anyway. Better focus on replacing json with binary/ssz.

@karalabe karalabe closed this Jul 22, 2024
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