Sha256: e3c9ef1fa39544f636c2905eb3dd4c92f92eb8e8b6d301b473e5e099cb7adf00

Contents?: true

Size: 627 Bytes

Versions: 180

Compression:

Stored size: 627 Bytes

Contents

require 'benchmark'
require_relative "../../lib/public_suffix"

JP   = "www.yokoshibahikari.chiba.jp"

TIMES = (ARGV.first || 50_000).to_i

# Initialize
class PublicSuffix::List
  public :select
end
PublicSuffixList = PublicSuffix::List.default
PublicSuffixList.select("example.jp")
PublicSuffixList.find("example.jp")

Benchmark.bmbm(25) do |x|
  x.report("JP select") do
    TIMES.times { PublicSuffixList.select(JP) }
  end
  x.report("JP find") do
    TIMES.times { PublicSuffixList.find(JP) }
  end
  # x.report("JP (noprivate)") do
  #   TIMES.times { PublicSuffixList.find(JP, ignore_private: true) != nil }
  # end
end

Version data entries

180 entries across 162 versions & 20 rubygems

Version Path
public_suffix-4.0.4 test/benchmarks/bm_select.rb
cloudsmith-api-0.49.118 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
cloudsmith-api-0.49.98 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
cloudsmith-api-0.49.94 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.1/test/benchmarks/bm_select.rb
cloudsmith-api-0.49.21 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
cloudsmith-api-0.49.15 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
cloudsmith-api-0.49.13 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
cloudsmith-api-0.49.9 vendor/bundle/ruby/2.3.0/gems/public_suffix-4.0.3/test/benchmarks/bm_select.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/public_suffix-3.1.0/test/benchmarks/bm_select.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/public_suffix-3.1.0/test/benchmarks/bm_select.rb
public_suffix-4.0.3 test/benchmarks/bm_select.rb
public_suffix-4.0.2 test/benchmarks/bm_select.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/public_suffix-3.1.0/test/benchmarks/bm_select.rb
tdiary-5.1.0 vendor/bundle/gems/public_suffix-4.0.1/test/benchmarks/bm_select.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.1/test/benchmarks/bm_select.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/public_suffix-4.0.1/test/benchmarks/bm_select.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/public_suffix-4.0.1/test/benchmarks/bm_select.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/public_suffix-4.0.1/test/benchmarks/bm_select.rb