github.com/segmentio/parquet-go@v0.0.0-20230712180008-5d42db8f0d47/bloom/filter_amd64.go (about)

     1  //go:build !purego
     2  
     3  package bloom
     4  
     5  // This file contains the signatures for bloom filter algorithms implemented in
     6  // filter_amd64.s.
     7  //
     8  // The assembly code provides significant speedups on filter inserts and checks,
     9  // with the greatest gains seen on the bulk insert operation where the use of
    10  // vectorized code yields great results.
    11  //
    12  // The following sections record the kind of performance improvements we were
    13  // able to measure, comparing with performing the filter block lookups in Go
    14  // and calling to the block insert and check routines:
    15  //
    16  // name              old time/op    new time/op     delta
    17  // FilterInsertBulk    45.1ns ± 2%    17.8ns ± 3%   -60.41%  (p=0.000 n=10+10)
    18  // FilterInsert        3.48ns ± 2%     2.55ns ± 1%  -26.86%  (p=0.000 n=10+8)
    19  // FilterCheck         3.64ns ± 3%     2.66ns ± 2%  -26.82%  (p=0.000 n=10+9)
    20  //
    21  // name              old speed      new speed       delta
    22  // FilterInsertBulk  11.4GB/s ± 2%  28.7GB/s ± 3%  +152.61%  (p=0.000 n=10+10)
    23  // FilterInsert      9.19GB/s ± 2%  12.56GB/s ± 1%  +36.71%  (p=0.000 n=10+8)
    24  // FilterCheck       8.80GB/s ± 3%  12.03GB/s ± 2%  +36.61%  (p=0.000 n=10+9)
    25  
    26  //go:noescape
    27  func filterInsertBulk(f []Block, x []uint64)
    28  
    29  //go:noescape
    30  func filterInsert(f []Block, x uint64)
    31  
    32  //go:noescape
    33  func filterCheck(f []Block, x uint64) bool