GithubHelp home page GithubHelp logo

salespaulo / merkleset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bramcohen/merkleset

0.0 1.0 0.0 122 KB

A highly performant merkle set data structure. To be ported to C later.

License: Other

Python 100.00%

merkleset's Introduction

MerkleSet

A highly performant Merkle set data structure

Merkle set implementations tend to have very poor cache coherence because nodes are often stored nowhere near each other in memory. The non-reference implemention in here does a good job of keeping parent and sibling nodes nearby, thus dramatically reducing the number of cache misses and improving performance.

RefenceMerkleSet.py contains a simple reference implementation.

MerkleSet.py contains an implementation which will be very performant after porting to C. A number of aspects of it don't make much sense in Python, most notably the _ref and _deref methods, which should be replaced with simple referencing and dereferencing on a port to C. This was written in a slightly odd style specifically for the purposes of making porting to C a direct transliteration.

TestMerkleSet.py does extensive testing of both implementions. It gets 98% code coverage and handles many semantic edge cases as well.

merkleset's People

Contributors

kanzure avatar

Watchers

James Cloos avatar

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.