Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Benchmark custom btcec vs btcec v2 #94

Open
norswap opened this issue May 10, 2022 · 2 comments
Open

Benchmark custom btcec vs btcec v2 #94

norswap opened this issue May 10, 2022 · 2 comments
Labels
tenderlovingcare Not urgent, but wholesome

Comments

@norswap
Copy link
Contributor

norswap commented May 10, 2022

@geohot brought the btcec code into minigeth (commit), and made a change to it to speed it up (commit).

That change is essentially to hardcode a precomputed chunk of data that the secp256k1 implementation needs, instead of computing it on the fly on each run. This shaves some / a lot of time (but how much?) off the execution.

Meanwhile, upstream geth migrated to btcec v2 (cf. blame on signature_nocgo.go)

I've opted to preserve George's implementation in minigeth, but we should probably try to benchmark both implementation against each other, and revert to the upstream default if it's faster or the custom implementation gives only very modest gains.

@norswap norswap added the tenderlovingcare Not urgent, but wholesome label May 10, 2022
@geohot
Copy link
Contributor

geohot commented May 10, 2022

Oh it's a huge amount of instructions to unpack the secp256k1, like 200M. Try it. I wouldn't have done a custom one if I didn't have to to get a block to run in reasonable time.

@norswap
Copy link
Contributor Author

norswap commented May 10, 2022

Maybe there's a chance they somehow improved things in v2?
Anyhow, this is very low priority.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tenderlovingcare Not urgent, but wholesome
Projects
None yet
Development

No branches or pull requests

2 participants