"eql?" performance issue / rails url helper #65

Closed
kaipr opened this Issue Jun 18, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@kaipr

kaipr commented Jun 18, 2012

I recently noticed some rails url helpers to be exceptionally slow (120ms in some cases) and tracked it down to the use of "eql?" on couch_potato models. For some reason a standard book_path(book) results in a book.eql?(book) call, resulting in 2 to_json calls on the book (which is no problem for other ORM/ODMs).

Is there any reason to do content comparisons there? ActiveRecord, mongoid etc. all do id comparisons only and as there is no test for content equality in couch_potato, I would assume it's not needed here too?

I'll do a pull request later, but wanted to know if there is or was a reason for the content comparison.

@langalex

This comment has been minimized.

Show comment Hide comment
@langalex

langalex Jun 18, 2012

Owner

I can't remember any reason, so a pull request would be great.

Owner

langalex commented Jun 18, 2012

I can't remember any reason, so a pull request would be great.

@langalex

This comment has been minimized.

Show comment Hide comment
@langalex

langalex Feb 3, 2013

Owner

Thanks, I (finally) pulled this in after debugging a performance issue for 2h that came down to exactly that.

Owner

langalex commented Feb 3, 2013

Thanks, I (finally) pulled this in after debugging a performance issue for 2h that came down to exactly that.

@langalex langalex closed this Feb 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment