Giter Site home page Giter Site logo

wyhash-1's Introduction

wyhash

A Go implementation of the 64-bit wyhash algorithm with a lot of optimizations. (final version 1)

original C++ implementation: https://github.com/wangyi-fudan/wyhash

QuickStart

package main

import "github.com/zhangyunhao116/wyhash"

func main() {
	println(wyhash.Sum64String("hello world!"))
}

Benchmark

Go version: go1.15.6 linux/amd64

CPU: AMD 3700x(8C16T), running at 3.6GHz

OS: ubuntu 18.04

MEMORY: 16G x 2 (3200MHz)

name              time/op
Wyhash/0-16         3.08ns ± 0%
Wyhash/1-16         4.09ns ± 0%
Wyhash/2-16         4.09ns ± 0%
Wyhash/3-16         4.09ns ± 1%
Wyhash/4-16         3.29ns ± 2%
Wyhash/5-16         3.71ns ± 1%
Wyhash/6-16         3.71ns ± 0%
Wyhash/7-16         3.76ns ± 3%
Wyhash/8-16         3.39ns ± 2%
Wyhash/9-16         3.78ns ± 2%
Wyhash/10-16        3.76ns ± 0%
Wyhash/11-16        3.76ns ± 0%
Wyhash/12-16        3.78ns ± 1%
Wyhash/13-16        3.76ns ± 1%
Wyhash/14-16        3.79ns ± 2%
Wyhash/15-16        3.77ns ± 0%
Wyhash/16-16        3.76ns ± 0%
Wyhash/17-16        4.98ns ± 0%
Wyhash/21-16        4.79ns ± 0%
Wyhash/24-16        4.39ns ± 2%
Wyhash/29-16        4.81ns ± 1%
Wyhash/32-16        4.77ns ± 0%
Wyhash/33-16        6.04ns ± 0%
Wyhash/64-16        7.25ns ± 1%
Wyhash/69-16        7.33ns ± 0%
Wyhash/96-16        8.31ns ± 0%
Wyhash/97-16        9.19ns ± 0%
Wyhash/128-16       10.4ns ± 0%
Wyhash/129-16       10.2ns ± 0%
Wyhash/240-16       15.7ns ± 3%
Wyhash/241-16       16.7ns ± 1%
Wyhash/512-16       28.2ns ± 1%
Wyhash/1024-16      50.2ns ± 1%
Wyhash/102400-16    4.27µs ± 0%

name              speed
Wyhash/0-16
Wyhash/1-16        245MB/s ± 0%
Wyhash/2-16        489MB/s ± 0%
Wyhash/3-16        733MB/s ± 1%
Wyhash/4-16       1.22GB/s ± 2%
Wyhash/5-16       1.35GB/s ± 1%
Wyhash/6-16       1.62GB/s ± 0%
Wyhash/7-16       1.86GB/s ± 3%
Wyhash/8-16       2.36GB/s ± 2%
Wyhash/9-16       2.39GB/s ± 0%
Wyhash/10-16      2.66GB/s ± 0%
Wyhash/11-16      2.92GB/s ± 0%
Wyhash/12-16      3.17GB/s ± 1%
Wyhash/13-16      3.45GB/s ± 0%
Wyhash/14-16      3.69GB/s ± 2%
Wyhash/15-16      3.99GB/s ± 0%
Wyhash/16-16      4.26GB/s ± 0%
Wyhash/17-16      3.41GB/s ± 0%
Wyhash/21-16      4.39GB/s ± 0%
Wyhash/24-16      5.46GB/s ± 2%
Wyhash/29-16      6.03GB/s ± 1%
Wyhash/32-16      6.72GB/s ± 0%
Wyhash/33-16      5.47GB/s ± 0%
Wyhash/64-16      8.83GB/s ± 1%
Wyhash/69-16      9.42GB/s ± 0%
Wyhash/96-16      11.6GB/s ± 0%
Wyhash/97-16      10.6GB/s ± 0%
Wyhash/128-16     12.3GB/s ± 0%
Wyhash/129-16     12.6GB/s ± 0%
Wyhash/240-16     15.3GB/s ± 2%
Wyhash/241-16     14.5GB/s ± 1%
Wyhash/512-16     18.1GB/s ± 1%
Wyhash/1024-16    20.4GB/s ± 1%
Wyhash/102400-16  24.0GB/s ± 0%

wyhash-1's People

Contributors

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