Code Monkey home page Code Monkey logo

pedersen-bench's Introduction

Pedersen Hash Benchmark

Comparison of performance of various Pedersen hash implementations.

Results

Results are divided into two categories: native and Node.js/WebAssembly. Node.js/WebAssembly benchmark results are only presented for Node.js as it has reasonably good WebAssembly performance with the V8 engine.

Native results

pathfinder ๐Ÿ‘‘ starknet-rs starknet-signatures
pedersen_hash 27.858 ยตs 31.990 ยตs 143.21 ยตs
Relative 1.00x 1.15x 5.14x

Node.js/WebAssembly results

starknet-rs ๐Ÿ‘‘ micro-starknet
pedersen_hash 228.67 ยตs 1.573 ms
Relative 1.00x 6.88x

Implementations

Here's the list of implementations tested along with their platform availability.

Implementation Native Node.js/WebAssembly
geometryresearch/starknet-signatures โœ… โŒ
eqlabs/pathfinder โœ… โŒ
xJonathanLEI/starknet-rs โœ… โœ…
paulmillr/micro-starknet โŒ โœ…

Environment

  • CPU

    AMD Ryzen 9 5950X 16-Core Processor

  • OS

    Ubuntu 20.04.5 LTS

  • Runtimes

    • wasmer-js: wasmer-js 0.4.1
    • Node.js: v18.12.1

Running benchmarks

Native benchmarks

To run the native benchmarks:

$ cargo bench

WebAssembly benchmarks

To run the WebAssembly benchmarks, make sure you have wasm32-wasi target and cargo-wasi installed. Then build the wasm file:

$ ./scripts/build_bench_wasm.sh

Then you can run the benchmark with your target runtime. For example, to run the benchmark against wasmer-js (Node.js):

$ ./scripts/run_bench_wasm.sh wasmer-js

For more information regarding wasm benchmarks with criterion.rs, check out this guide.

Node.js benchmarks

To run non-wasm Node.js benchmarks, first build the benchmark script:

$ yarn install
$ yarn build

Then run the script with node:

$ node build/js-bench.js

pedersen-bench's People

Contributors

xjonathanlei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zeta1999

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.