Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some performance benchmarking for take vs limit #11336

Merged
merged 1 commit into from
Jul 6, 2013
Merged

Some performance benchmarking for take vs limit #11336

merged 1 commit into from
Jul 6, 2013

Conversation

ankit8898
Copy link
Contributor

Also added a dummy progress bar during insert of records so it shows something is happening.
Performance report

      Model.take     6198.9 (±13.4%) i/s -     121743 in  20.042671s
      Model.take!     6173.6 (±13.6%) i/s -     121242 in  20.057006s
      Model.all limit(100)      107.8 (±15.8%) i/s -       2106 in  20.022316s
      Model.all take(100)      105.2 (±15.2%) i/s -       2061 in  20.062509s

end

x.report 'Model.take!' do
Exhibit.take
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be take!?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well ideally it should be take vs limit. As both form the same LIMIT sql. I was checking the BM of take and take! also if there is a overhead. I think we can remove take!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

@ankit8898
Copy link
Contributor Author

@rafaelfranca removed take!

@rafaelfranca
Copy link
Member

Could you squash your commits please?

Also added a dummy progress bar during insert of records so it shows something is happening.
Performance report
          Model.take     6198.9 (±13.4%) i/s -     121743 in  20.042671s
         Model.take!     6173.6 (±13.6%) i/s -     121242 in  20.057006s
Model.all limit(100)      107.8 (±15.8%) i/s -       2106 in  20.022316s
 Model.all take(100)      105.2 (±15.2%) i/s -       2061 in  20.062509s
@ankit8898
Copy link
Contributor Author

@rafaelfranca Done 👍

rafaelfranca added a commit that referenced this pull request Jul 6, 2013
Some performance benchmarking for take vs limit
@rafaelfranca rafaelfranca merged commit 8f25e08 into rails:master Jul 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants