Comparing the performance of ECDSA signature validation in OpenSSL vs. libsecp256k1 over the last decade

Posted by sipa

Nov 2, 2025/15:49 UTC

The analysis of script performance on a Ryzen 5950X CPU, with 500,000 iterations, reveals a significant variance in speed ratios, highlighting an 8.5 current speed ratio. The evaluation indicates no speed gain in bc-22.0, showing instead a 3.6% decrease in performance due to the safegcd code. Conversely, an 8% improvement in speed was observed in bc-27.0, attributed to the removal of x86_64 assembly as documented in the pull request libsecp256k1 v0.4.1.

This discrepancy in performance metrics suggests several underlying biases and considerations. Firstly, the benchmarks were conducted on identical hardware to maintain fairness, despite the original code development being optimized for the diversity in hardware available at the time, including differences within the same architecture (e.g., x86_64) and the shifting popularity of architectures over time (e.g., the rise of aarch64). Moreover, the benchmarking utilized the same compiler across tests, which does not account for historical optimization efforts targeted at enhancing performance for the then-current compilers. A notable example is the previously superior performance of x86_64 field assembly code compared to machine code from pure C, a gap that has significantly narrowed with advancements in modern compilers, leading to its removal in version 0.4.1.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback