Created
December 4, 2012 12:57
-
-
Save solnic/4203569 to your computer and use it in GitHub Desktop.
dm1 vs dm2 - eager loading association
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3p327 :011 > Benchmark.bm { |x| x.report { User.all.each { |u| u.city } } } | |
user system total real | |
4.320000 0.010000 4.330000 ( 4.344362) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3p327 :004 > Benchmark.bm { |x| x.report { DataMapper[User].include(:city).each { |u| u.city } } } | |
user system total real | |
2.090000 0.010000 2.100000 ( 2.135567) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
City eagerly loaded in the first case ?