Sha256: 974dda0523781b050ade8e1d0004647e87fa37ca8f6a6da89d5d5f688dd65ef0

Contents?: true

Size: 531 Bytes

Versions: 30

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe "Performance testing" do
  let(:disposable_domain) { ValidEmail2.disposable_emails.first }

  it "has acceptable lookup performance" do
    address = ValidEmail2::Address.new("test@example.com")

    # preload list and check size
    expect(ValidEmail2.disposable_emails).to be_a(Set)
    expect(ValidEmail2.disposable_emails.count).to be > 30000

    # check lookup timing
    expect { address.disposable_domain? }.to perform_under(0.0001).sample(10).times
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
valid_email2-7.0.0 spec/benchmark_spec.rb
valid_email2-6.0.0 spec/benchmark_spec.rb
valid_email2-5.3.0 spec/benchmark_spec.rb
valid_email2-5.2.6 spec/benchmark_spec.rb
valid_email2-5.2.5 spec/benchmark_spec.rb
valid_email2-5.2.4 spec/benchmark_spec.rb
valid_email2-5.2.3 spec/benchmark_spec.rb
valid_email2-5.2.1 spec/benchmark_spec.rb
valid_email2-5.2.0 spec/benchmark_spec.rb
valid_email2-5.1.1 spec/benchmark_spec.rb
valid_email2-5.1.0 spec/benchmark_spec.rb
valid_email2-5.0.5 spec/benchmark_spec.rb
valid_email2-5.0.4 spec/benchmark_spec.rb
valid_email2-5.0.3 spec/benchmark_spec.rb
valid_email2-5.0.2 spec/benchmark_spec.rb
valid_email2-5.0.1 spec/benchmark_spec.rb
valid_email2-5.0.0 spec/benchmark_spec.rb
valid_email2-4.0.6 spec/benchmark_spec.rb
valid_email2-4.0.5 spec/benchmark_spec.rb
valid_email2-4.0.4 spec/benchmark_spec.rb