paulmillr / scure-base

Secure, audited & 0-deps implementation of bech32, base64, base32, base16 & base58
https://paulmillr.com/noble/#scure
MIT License
106 stars 13 forks source link

Speed-up hex using noble technique. #30

Open paulmillr opened 6 months ago

paulmillr commented 6 months ago

The PR makes hex decoding 23x faster on 8KB inputs.

The cost: +40 lines of code.

Should we do it? Is hex a bottleneck?

arobsn commented 2 months ago

I think it's a really small price to pay for such a big performance improvement.

paulmillr commented 2 months ago

@arobsn is it relevant to your use case? Is it a bottleneck in your case?

paulmillr commented 2 months ago

I mean, we can speed-up every function, but that would make package big. If we speed up only some functions, we need to select which ones.

arobsn commented 2 months ago

I usually avoid using it because it's too slow, but yes, not really an issue for my use case. My point is that 40 lines of code is a good price to pay for a 23x performance boost.