forked from huacnlee/mongoid_auto_increment_id
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
36 lines (32 loc) · 717 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'rake'
require "rspec"
require File.expand_path('../spec/spec_helper', __FILE__)
task :default do
system 'bundle exec rspec spec'
end
task :benchmark do
Benchmark.bm do|bm|
Post.delete_all
bm.report("Generate 1") do
1.times do
Post.create(:title => "Foo bar")
end
end
puts "Post current: #{Post.count}"
puts ""
bm.report("Generate 100") do
100.times do
Post.create(:title => "Foo bar")
end
end
puts "Post current: #{Post.count}"
puts ""
bm.report("Generate 10,000") do
10_000.times do
Post.create(:title => "Foo bar")
end
end
puts "Post current: #{Post.count}"
puts ""
end
end