Sha256: 8ccbf81fef6ee97f4bf1071f29ba3d2bf1ee2704d83f48b0fb8bfd241113c789
Contents?: true
Size: 762 Bytes
Versions: 11
Compression:
Stored size: 762 Bytes
Contents
#!/usr/bin/env ruby require "bundler/setup" require "active_remote" require "benchmark/ips" require "./spec/support/models/typecasted_author" ATTRIBUTES = { :guid => "0c030733-3b78-4587-b94b-5e0cf26497c5", :name => "Charles Dickens", :age => 68, :birthday => "1812-02-07 00:00:00", :writes_fiction => true, :net_sales => 1_000_000.0 } ::Benchmark.ips do |x| x.config(:time => 20, :warmup => 10) x.report("initialize") do ::TypecastedAuthor.new(ATTRIBUTES) end x.report("instantiate") do ::TypecastedAuthor.instantiate(ATTRIBUTES) end x.report("init attributes") do ::TypecastedAuthor.new(ATTRIBUTES).attributes end x.report("inst attributes") do ::TypecastedAuthor.instantiate(ATTRIBUTES).attributes end end
Version data entries
11 entries across 11 versions & 1 rubygems