Skip to content

Instantly share code, notes, and snippets.

@jpr5
Created August 11, 2010 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpr5/518333 to your computer and use it in GitHub Desktop.
Save jpr5/518333 to your computer and use it in GitHub Desktop.
# dm-core 0.10.2 <- our current point
creating 20 models took: 0.890000 0.250000 1.140000 ( 1.147287)
# dm-core v1.0.0
creating 20 models took: 1.350000 0.440000 1.790000 ( 1.791719)
# dm-core e7b5f186 <- somewhere after 1.0.0, time is climbing
creating 20 models took: 1.540000 0.520000 2.060000 ( 2.061627)
# dm-core ad298724 <- git bisect tells me this is the bad one
creating 20 models took: 2.290000 0.850000 3.140000 ( 3.141820)
#!/usr/bin/ruby -rubygems
# Gems pegged at edge
require 'dm-core' # 75c67e61
require 'dm-migrations' # 69551c93
# Gems pegged at 1.0.0
require 'dm-types'
require 'dm-timestamps'
require 'dm-validations'
require 'dm-serializer'
require 'dm-aggregates'
require 'dm-ar-finders'
require 'dm-transactions'
# + do_mysql 0.9.12
require 'benchmark'
foo = Benchmark.measure {
20.times do |n|
class << Class.new
include ::DataMapper::Resource
10.times do |x|
property "str#{x}".to_sym, String
end
10.times do |x|
property "num#{x}".to_sym, Integer
end
10.times do |x|
property "bool#{x}".to_sym, Boolean
end
10.times do |x|
property "decimal#{x}".to_sym, Decimal, :scale => 2, :precision => 6
end
10.times do |x|
property "float#{x}".to_sym, Float
end
end
end
}
puts "creating #{a} models took: #{foo}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment