Sha256: 05020feb6f128e126583485fa07af7e1b4a4c68115d8121c824f78da541c0b04

Contents?: true

Size: 473 Bytes

Versions: 2

Compression:

Stored size: 473 Bytes

Contents

require "bloomed"

KB = 2 ** 10

module Seeder

  def self.seed(all: false, cache_dir: nil)
    ps = [0.01, 0.001, 0.0001]
    cs = [1E4, 1E5]

    if all
      cs += [1E6, 1E7, 1E8]
    end

    cs.product(ps).each do |c, p|
      print "Generating filter for top #{c.to_i} with #{p} precision "
      b = Bloomed::PW.new(top: c, false_positive_probability: p, cache_dir: cache_dir)
      size = File.size(b.filename)
      puts "Done [#{size / KB} kb]"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bloomed-1.2.1 lib/seeder.rb
bloomed-1.2.0 lib/seeder.rb