Sha256: cd07f407d4e0505382bad66df7d3375d124e645df4dd1d95753734b77594a835

Contents?: true

Size: 283 Bytes

Versions: 5

Compression:

Stored size: 283 Bytes

Contents

# frozen_string_literal: true

require_relative 'setup'

schema = Dry::Types['params.hash'].schema(
  email?: 'string',
  age?: 'params.integer'
).lax

params = { email: 'jane@doe.org', age: '19' }

Benchmark.ips do |x|
  x.report("valid input") { schema.(params) }
  x.compare!
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-types-1.2.2 benchmarks/lax_schema.rb
dry-types-1.2.1 benchmarks/lax_schema.rb
dry-types-1.2.0 benchmarks/lax_schema.rb
dry-types-1.1.1 benchmarks/lax_schema.rb
dry-types-1.1.0 benchmarks/lax_schema.rb