Created
January 15, 2011 17:47
-
-
Save rafaelss/781083 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
models | |
------ | |
class Bookmark | |
referenced_in :user | |
end | |
class User | |
references_many :bookmarks, :dependent => :destroy | |
end | |
index.slim | |
---------- | |
@bookmarks.each do |bookmark| | |
... | |
= bookmark.user.username | |
... | |
beta.20 log | |
----------- | |
(repeated at least 50 times) | |
truffls_development['bookmarks'].find({"$or"=>[{:private=>false}, {:private=>true, :user_id=>BSON::ObjectId('4d16ae21a46a2d600b000005')}]}, {}).limit(50).sort([[:created_at, :desc], [:updated_at, :desc]]) | |
truffls_development['users'].find({:_id=>BSON::ObjectId('4d16ae21a46a2d600b000005')}, {}).limit(-1) | |
beta.20 response time | |
--------------------- | |
Completed 200 OK in 291ms (Views: 276.6ms) | |
rc.4 log | |
-------- | |
(repeated at least 50 times) | |
truffls_development['bookmarks'].find({"$or"=>[{:private=>false}, {:private=>true, :user_id=>BSON::ObjectId('4d16ae21a46a2d600b000005')}]}, {}).limit(50).sort([[:created_at, :desc], [:updated_at, :desc]]) | |
truffls_development['users'].find({:_id=>BSON::ObjectId('4d16ae21a46a2d600b000005')}, {}).limit(-1) | |
truffls_development['bookmarks'].find({"user_id"=>BSON::ObjectId('4d16ae21a46a2d600b000005')}, {}) | |
MONGODB cursor.refresh() for cursor 6223321165071467073 | |
rc.4 response time | |
------------------ | |
Completed 200 OK in 14728ms (Views: 14714.9ms) |
master is freaking fast!
Completed 200 OK in 214ms (Views: 197.7ms)
Ok that's a weight off my chest... Thank you very much for providing the gist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this... Can you try pointing at master and see if that helps it? I expect the relational stuff in the rc's to be slightly slower, but this is ridiculous... I did make a commit that should help this out at:
mongoid/mongoid@6e4df4d