github.com/zhangyunhao116/wyhash@v0.4.1-0.20220217162229-7d42996fa899/readme.md (about)

     1  ## wyhash
     2  
     3  A Go implementation of the 64-bit *wyhash* algorithm with a lot of optimizations. (final version 1 and final version 3)
     4  
     5  original C++ implementation: https://github.com/wangyi-fudan/wyhash
     6  
     7  
     8  
     9  ## QuickStart
    10  
    11  ```go
    12  package main
    13  
    14  import "github.com/zhangyunhao116/wyhash"
    15  
    16  func main() {
    17  	println(wyhash.Sum64String("hello world!"))   // final version 1
    18  	println(wyhash.Sum64StringV3("hello world!")) // final version 3
    19  }
    20  
    21  ```
    22  
    23  
    24  
    25  ## Benchmark
    26  
    27  Version: final version 1
    28  
    29  Go version: go1.15.6 linux/amd64
    30  
    31  CPU: AMD 3700x(8C16T), running at 3.6GHz
    32  
    33  OS: ubuntu 18.04
    34  
    35  MEMORY: 16G x 2 (3200MHz)
    36  
    37  ```
    38  name              time/op
    39  Wyhash/0-16         3.08ns ± 0%
    40  Wyhash/1-16         4.09ns ± 0%
    41  Wyhash/2-16         4.09ns ± 0%
    42  Wyhash/3-16         4.09ns ± 1%
    43  Wyhash/4-16         3.29ns ± 2%
    44  Wyhash/5-16         3.71ns ± 1%
    45  Wyhash/6-16         3.71ns ± 0%
    46  Wyhash/7-16         3.76ns ± 3%
    47  Wyhash/8-16         3.39ns ± 2%
    48  Wyhash/9-16         3.78ns ± 2%
    49  Wyhash/10-16        3.76ns ± 0%
    50  Wyhash/11-16        3.76ns ± 0%
    51  Wyhash/12-16        3.78ns ± 1%
    52  Wyhash/13-16        3.76ns ± 1%
    53  Wyhash/14-16        3.79ns ± 2%
    54  Wyhash/15-16        3.77ns ± 0%
    55  Wyhash/16-16        3.76ns ± 0%
    56  Wyhash/17-16        4.98ns ± 0%
    57  Wyhash/21-16        4.79ns ± 0%
    58  Wyhash/24-16        4.39ns ± 2%
    59  Wyhash/29-16        4.81ns ± 1%
    60  Wyhash/32-16        4.77ns ± 0%
    61  Wyhash/33-16        6.04ns ± 0%
    62  Wyhash/64-16        7.25ns ± 1%
    63  Wyhash/69-16        7.33ns ± 0%
    64  Wyhash/96-16        8.31ns ± 0%
    65  Wyhash/97-16        9.19ns ± 0%
    66  Wyhash/128-16       10.4ns ± 0%
    67  Wyhash/129-16       10.2ns ± 0%
    68  Wyhash/240-16       15.7ns ± 3%
    69  Wyhash/241-16       16.7ns ± 1%
    70  Wyhash/512-16       28.2ns ± 1%
    71  Wyhash/1024-16      50.2ns ± 1%
    72  Wyhash/102400-16    4.27µs ± 0%
    73  
    74  name              speed
    75  Wyhash/0-16
    76  Wyhash/1-16        245MB/s ± 0%
    77  Wyhash/2-16        489MB/s ± 0%
    78  Wyhash/3-16        733MB/s ± 1%
    79  Wyhash/4-16       1.22GB/s ± 2%
    80  Wyhash/5-16       1.35GB/s ± 1%
    81  Wyhash/6-16       1.62GB/s ± 0%
    82  Wyhash/7-16       1.86GB/s ± 3%
    83  Wyhash/8-16       2.36GB/s ± 2%
    84  Wyhash/9-16       2.39GB/s ± 0%
    85  Wyhash/10-16      2.66GB/s ± 0%
    86  Wyhash/11-16      2.92GB/s ± 0%
    87  Wyhash/12-16      3.17GB/s ± 1%
    88  Wyhash/13-16      3.45GB/s ± 0%
    89  Wyhash/14-16      3.69GB/s ± 2%
    90  Wyhash/15-16      3.99GB/s ± 0%
    91  Wyhash/16-16      4.26GB/s ± 0%
    92  Wyhash/17-16      3.41GB/s ± 0%
    93  Wyhash/21-16      4.39GB/s ± 0%
    94  Wyhash/24-16      5.46GB/s ± 2%
    95  Wyhash/29-16      6.03GB/s ± 1%
    96  Wyhash/32-16      6.72GB/s ± 0%
    97  Wyhash/33-16      5.47GB/s ± 0%
    98  Wyhash/64-16      8.83GB/s ± 1%
    99  Wyhash/69-16      9.42GB/s ± 0%
   100  Wyhash/96-16      11.6GB/s ± 0%
   101  Wyhash/97-16      10.6GB/s ± 0%
   102  Wyhash/128-16     12.3GB/s ± 0%
   103  Wyhash/129-16     12.6GB/s ± 0%
   104  Wyhash/240-16     15.3GB/s ± 2%
   105  Wyhash/241-16     14.5GB/s ± 1%
   106  Wyhash/512-16     18.1GB/s ± 1%
   107  Wyhash/1024-16    20.4GB/s ± 1%
   108  Wyhash/102400-16  24.0GB/s ± 0%
   109  ```
   110