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

Add benchmark #2855

Merged
merged 6 commits into from
Nov 21, 2023
Merged

Conversation

salochara
Copy link
Contributor

@salochara salochara commented Nov 13, 2023

Motivation / Background

Fixes #2851

In this PR, @okaydokay97 and I are adding a rake task to run a benchmark on every Faker generator!

Here's a screenshot of the results:
CleanShot 2023-11-13 at 15 06 27@2x

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • [N/A] Tests are added or updated if you fix a bug, refactor something, or add a feature.
  • [N/A] Tests and Rubocop are passing before submitting your proposed changes.

salochara and others added 3 commits November 13, 2023 14:53
Add benchmark rake task for evaluating time execution. Fixes

Co-authored-by: Rubens Fernandes <rubens.fernandes97@gmail.com>
@salochara salochara changed the title Feature/add benchmark Add benchmark Nov 13, 2023
tasks/benchmark.rake Outdated Show resolved Hide resolved
Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

Excellent contribution, thanks for working on this!

This is a great first step to help us improve the performance of the gem. 🙏

Thanks @salochara and @okaydokay97 for working on this!

I just left one suggestion, let me know what you think.

- Build all_methods outside the benchmark since we don't want to measure that.
@salochara
Copy link
Contributor Author

Hi @thdaraujo !
I've resolved the suggestion.

This is looking good!
Wondering on the next steps for this performance issue that we want to tackle.
What do you think are the next steps?

Probably we can create an "issue" here on GH have a simple draft on next steps, things to do.

Would love to keep on contributing !

All the best! 🙏🏼
Salo.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Thank you both! I left a small suggestion.

In terms of the next steps, I added a comment in the issue to keep things centralized there.

tasks/benchmark.rake Outdated Show resolved Hide resolved
- Avoid calling the same object twice
@salochara
Copy link
Contributor Author

Done! ✅

Awesome... I'll have a look at it whenever I get a chance.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Thank you for working on this! Excited to see how we can improve faker's performance :)

@stefannibrasil stefannibrasil merged commit e4ab99f into faker-ruby:main Nov 21, 2023
7 checks passed
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.

Add benchmarking to faker-ruby
3 participants