Giter Site home page Giter Site logo

cgh's Introduction

cgh

C version GodelHash

Compile and Run:

  • Install libgmp-dev on Linux.
  • make
  • ./eval_sets ./primes-db/primes10000000.txt 1000 5000 10000 50 50 50

Usage: eval_sets prime-number-file times-of-operations set-size universe-size contains-true-ratio includes-true-ratio equals-true-ratio [latex-output]

This program runs each operations 'times-of-operations' times on sets containing 'set-size' elements randomly fetched from the 'universe-size' prime space.

Evaluated on Emulab machine, hardware spec:

  • Intel Xeon E5-1660 3.3GHz six-core CPU
  • 32GB DDR3-2133 memory,
  • Intel X79 chipset motherboard
  • Smasung 840 Pro 128GB SSD.

Implementation:

  • GodelHash based primeset: using GNU GMP (GNU Multiple Precision Aritchmetic library) for big integer aritchmetic operations.
  • Sorted Arrayset: using std::vector to store data, using std::binary_search, std::set_union/set_difference/includes/set_intersect algorithms for set operations.
  • Sorted Treeset: using std::set, which is a red-black tree based set implementation.
  • Hashset: using std::unordered_set, which is a bucket-based hashset.

Output: Times show are in nanoseconds for each single operation.

Explaination: GMP is highly optimized on modern CPUs to operate at very long data types with a single instruction. Instruction sets such as SSE and AVX can do 256 bits or even 512 bits data arithmetic operations.

cgh's People

Contributors

wbsun avatar

Stargazers

Caleb Johnson avatar Kevin Hatfield avatar

Watchers

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