Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update README for benchmark

  • Loading branch information...
commit ba2a29d1ec7baf20b757fdc1415af0163e18f459 1 parent e4bab92
@flyerhzm authored
Showing with 11 additions and 10 deletions.
  1. +1 −1  Gemfile.lock
  2. +10 −9 README.md
View
2  Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- mongoid-eager-loading (0.1.2)
+ mongoid-eager-loading (0.2.0)
GEM
remote: http://rubygems.org/
View
19 README.md
@@ -18,7 +18,7 @@ suppose you have a mongoid model Post
class Post
include Mongoid::Document
-
+
referenced_in :user
references_many :comments
end
@@ -27,9 +27,9 @@ then you can use the eager loading like
Post.includes(:user)
Post.includes(:user, :comments)
-
+
eager loading can be only used on referenced_in, references_one and references_many associations.
-
+
Benchmark
---------
@@ -37,12 +37,13 @@ I also run a [benchmark][1] on my local computer, the result is as follows
Starting benchmark...
user system total real
- Finding 10 posts with person, without eager loading 0.010000 0.000000 0.010000 ( 0.006538)
- Finding 10 posts with person, with eager loading 0.000000 0.000000 0.000000 ( 0.005235)
- Finding 50 posts with person, without eager loading 0.020000 0.000000 0.020000 ( 0.027912)
- Finding 50 posts with person, with eager loading 0.020000 0.000000 0.020000 ( 0.020103)
- Finding 100 posts with person, without eager loading 0.040000 0.000000 0.040000 ( 0.055197)
- Finding 100 posts with person, with eager loading 0.030000 0.010000 0.040000 ( 0.040644)
+ Finding 10 posts with person, without eager loading 0.010000 0.000000 0.010000 ( 0.005121)
+ Finding 10 posts with person, with eager loading 0.000000 0.000000 0.000000 ( 0.001886)
+ Finding 50 posts with person, without eager loading 0.020000 0.000000 0.020000 ( 0.021442)
+ Finding 50 posts with person, with eager loading 0.000000 0.000000 0.000000 ( 0.005267)
+ Finding 100 posts with person, without eager loading 0.050000 0.000000 0.050000 ( 0.057718)
+ Finding 100 posts with person, with eager loading 0.010000 0.000000 0.010000 ( 0.010141)
+
Author
------
Please sign in to comment.
Something went wrong with that request. Please try again.