Created
September 11, 2014 13:22
-
-
Save murajun1978/f71dd61373461256b5d7 to your computer and use it in GitHub Desktop.
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
posts = Post.all | |
Benchmark.bm do |x| | |
x.report(:exists) {posts.exists?} | |
x.report(:present) {posts.present?} | |
end | |
user system total real | |
Post Exists (0.3ms) SELECT 1 AS one FROM "posts" LIMIT 1 | |
exists 0.020000 0.000000 0.020000 ( 0.028894) | |
present 0.000000 0.000000 0.000000 ( 0.000018) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment