Coder Social home page Coder Social logo

zacharyjinwonton / fast-treap Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

A new algorithm for insertion in persistent balanced binary search trees (BST) on non-volatile memory (PMEM).

Makefile 1.54% Shell 4.05% C++ 89.09% C 5.32%
pmem bst selfbalancing redblacktree avl-tree treap maxheap nonvolatile recovery multithreading

fast-treap's Introduction

Fast-TREAP

This repo presents a new algorithm for insertion in persistent balanced binary search trees (BST) on non-volatile memory (PMEM).

Many conventional implementations for insertion in BSTs, including AVL trees, Red-Black trees, and TREAPs (tree-heaps), rely on tree rotations for maintaining balance to achieve better performance. Such rotations are expensive, especially when considering the PMEM environment. They require a sequence of writes which are very expensive in PMEM. Performing these writes in a manner such that no data are lost after a crash adds further complexity.

Fast-TREAP is a new algorithm for insertion in a TREAP that does not use tree rotations and there- fore does not suffer from these drawbacks. The conventional TREAP insertion algorithm first inserts the new key as a leaf in the TREAP according to the binary search tree property, and then moves it upward in the TREAP with performing rotations to restore the heap property. In contrast, Fast-TREAP inserts the new key immediately in its final location in the TREAP according to the heap property and then rearranges the sub-tree below it to restore the binary search tree property. Fast-TREAP requires fewer writes and makes it relatively easy to perform these writes such that the data structure is recoverable after a crash.

We demonstrate the superiority of Fast-TREAP on PMEM in comparison to AVL tree, Red-Black tree, and a conventional implementation of TREAP, using both random and sequential values for insertion. For instance, for inserting one million random keys in an empty BST, Fast-TREAP achieves an insertion rate of 1,023k per second, 28% better than its nearest competitor. For inserting one million sequential keys, it achieves an insertion rate of 1,644k per second, nearly double that of its closest competitor.

fast-treap's People

Contributors

zacharyjinwonton avatar

Watchers

 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.