Sha256: d11f78f0a397087d375228ffce3b235b93e320249c12f2e815c5ed2826e0d344

Contents?: true

Size: 525 Bytes

Versions: 25

Compression:

Stored size: 525 Bytes

Contents

require_relative 'suite'
require 'hotch'

require 'dry-validation'

I18n.locale = :en
I18n.backend.load_translations

COUNT = ENV['COUNT'].to_i
FIELDS = COUNT.times.map { |i| :"field_#{i}" }

schema = Dry::Validation.Schema do
  configure do
    config.messages = :i18n
  end

  FIELDS.each do |field|
    required(field).filled(gt?: FIELDS.size / 2)
  end
end

data = FIELDS.reduce({}) { |h, f| h.update(f => FIELDS.index(f) + 1) }

puts schema.(data).inspect

Hotch() do
  100.times do
    schema.(data).messages
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
dry-validation-0.13.3 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.13.2 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.13.1 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.11.2 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.12.3 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.13.0 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.12.2 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.12.1 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.12.0 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.11.1 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.11.0 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.7 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.6 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.5 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.4 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.3 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.2 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.1 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.10.0 benchmarks/profile_schema_huge_invalid.rb
dry-validation-0.9.5 benchmarks/profile_schema_huge_invalid.rb