Giter VIP home page Giter VIP logo

ruby-tabulation's Introduction

ruby-tabulation

Analyze if the Ruby hashing algorithm could be improved using Tabulation Hashing. This is a project for my Advanced Algorithms course by Alexandr Andoni at Columbia University.

The written C code for the project is in the tabulation_project branch of my fork of the Ruby project (MRI) in GitHub.

Ruby issue: https://bugs.ruby-lang.org/issues/16851

Results

benchmark_tabulation.rb benchmarks the insertion of 600000 elements (by hashing their 64 bits ids) in an empty hash 100 times. Below are the times (in seconds) I got executing this code for different versions of the Ruby code:

  • master (without Simple Tabulation): 29.68
  • master with Linear Probing (without Simple Tabulation): 99.76
  • master with Quadratic Probing (without Simple Tabulation): 29.97
  • master with Simple Tabulation: 15.76
  • master with Linear Probing and Simple Tabulation: 24.23
  • master with Quadratic Probing and Simple Tabulation: 13.73

master refers to ruby 2.8.0dev: (2020-05-07T16:22:38Z master 7ded8fd) [x86_64-linux]. I tried with 8 x Intel i5-8265U.

This prove the potential of Simple Tabulation to improve current Ruby implementation. For more details check the project report: latex/RubyTabulation_Project.pdf.

License

Code published under GNU GENERAL PUBLIC LICENSE v3 (see LICENSE).

ruby-tabulation's People

Contributors

ana06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.