What is Nostr?
Abdel / A₿del ∞/21M 🐺 - 🐱
npub1hr6…2e29
2024-08-09 11:52:55

Abdel on Nostr: Managed to beat the Rust implementation with a Zig implementation ⚡️ Initially it ...

Managed to beat the Rust implementation with a Zig implementation ⚡️
Initially it was slower, but, moving to use the same libsec256k1 C implementation for operations on SECP256k1 curve, now the Zig version is slightly faster.
113 micro seconds for the End to End BDHKE!

Zig is fast ⚡

Me today: write BDHKE scheme in Zig (https://github.com/AbdelStark/coconut).
Benchmark it: Oh wow it's super fast, 1 millisecond for the end to end scheme.
Find the Rust implementation (https://github.com/ngutech21/moksha) and benchmark it: it's about 10 times faster than my Zig implementation 😭

Gg Moksha folks! 🦀 is blazingly fast damn.

I suspect there might be a gap in terms of performance between the Secp256k1 implementation of the Zig std lib and the C implementation (the secp256k1 crate being a Rust wrapper library for Pieter Wuille's libsecp256k1 in C).

Zig benchmark:


Rut benchmark:

Author Public Key
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29