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

bench: refactor random number generation in JS benchmarks for stats/base/dists/logistic #5139

Merged
merged 11 commits into from
Feb 18, 2025

Conversation

gkbishnoi07
Copy link
Contributor

@gkbishnoi07 gkbishnoi07 commented Feb 9, 2025

Description

What is the purpose of this pull request?

This pull request:

  • Refactors random number generation in JS benchmarks for stats/base/dists/logistic.
  • Replaces randu() with uniform() for cleaner and more consistent code.
  • Moves the random number generation outside the benchmarking loops to improve efficiency.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request?

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Feb 9, 2025
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

Copy link
Contributor

@stdlib-bot stdlib-bot left a comment

Choose a reason for hiding this comment

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

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Feb 9, 2025

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/logistic/cdf $\color{green}209/209$
$\color{green}+100.00\%$
$\color{green}23/23$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}209/209$
$\color{green}+100.00\%$
stats/base/dists/logistic/ctor $\color{green}488/488$
$\color{green}+100.00\%$
$\color{green}36/36$
$\color{green}+100.00\%$
$\color{green}19/19$
$\color{green}+100.00\%$
$\color{green}488/488$
$\color{green}+100.00\%$
stats/base/dists/logistic/entropy $\color{green}113/113$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}113/113$
$\color{green}+100.00\%$
stats/base/dists/logistic/kurtosis $\color{green}175/175$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}175/175$
$\color{green}+100.00\%$
stats/base/dists/logistic/logcdf $\color{green}288/288$
$\color{green}+100.00\%$
$\color{green}29/29$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}288/288$
$\color{green}+100.00\%$
stats/base/dists/logistic/logpdf $\color{green}241/241$
$\color{green}+100.00\%$
$\color{green}27/27$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}241/241$
$\color{green}+100.00\%$
stats/base/dists/logistic/mean $\color{green}175/175$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}175/175$
$\color{green}+100.00\%$
stats/base/dists/logistic/median $\color{green}175/175$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}175/175$
$\color{green}+100.00\%$
stats/base/dists/logistic/mgf $\color{red}228/230$
$\color{green}+99.13\%$
$\color{red}17/18$
$\color{green}+94.44\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{red}228/230$
$\color{green}+99.13\%$
stats/base/dists/logistic/mode $\color{green}175/175$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}175/175$
$\color{green}+100.00\%$
stats/base/dists/logistic/pdf $\color{green}237/237$
$\color{green}+100.00\%$
$\color{green}27/27$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}237/237$
$\color{green}+100.00\%$
stats/base/dists/logistic/quantile $\color{green}218/218$
$\color{green}+100.00\%$
$\color{green}25/25$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}218/218$
$\color{green}+100.00\%$
stats/base/dists/logistic/skewness $\color{green}175/175$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}175/175$
$\color{green}+100.00\%$
stats/base/dists/logistic/stdev $\color{green}180/180$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}180/180$
$\color{green}+100.00\%$
stats/base/dists/logistic/variance $\color{green}176/176$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}176/176$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@anandkaranubc anandkaranubc added the Needs Changes Pull request which needs changes before being merged. label Feb 10, 2025
@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc ready for review

@anandkaranubc
Copy link
Contributor

@anandkaranubc ready for review

I noticed that you adjusted the spacing in the files, including areas of the code that do not require changes to resolve this issue. That is unnecessary. Reference PRs will help clarify which changes are required.

@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc ready for review

I noticed that you adjusted the spacing in the files, including areas of the code that do not require changes to resolve this issue. That is unnecessary. Reference PRs will help clarify which changes are required.

Thanks for the feedback! I’ll revert the unnecessary spacing changes and ensure only the required modifications are included. Appreciate the guidance!

@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc ready for review

@stdlib-bot stdlib-bot removed the First-time Contributor A pull request from a contributor who has never previously committed to the project repository. label Feb 11, 2025
@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc please review this

@gkbishnoi07
Copy link
Contributor Author

@Planeshifter please review

@anandkaranubc
Copy link
Contributor

@gkbishnoi07, I have left some comments for you to review. Good luck!

@gkbishnoi07
Copy link
Contributor Author

@gkbishnoi07, I have left some comments for you to review. Good luck!

Thank you! I'll review your comments and get back to you soon.

@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc Can you please review #5193

@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc ready for review

@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc any updates

@gkbishnoi07
Copy link
Contributor Author

@Planeshifter please review this PR

@gkbishnoi07
Copy link
Contributor Author

@kgryte can you please review this PRs

@anandkaranubc
Copy link
Contributor

@anandkaranubc ready for review

On it!

Copy link
Contributor

@anandkaranubc anandkaranubc left a comment

Choose a reason for hiding this comment

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

This PR still requires several changes. I have pinpointed the exact areas in my review. You can request another review from me after making those changes. Just ensure that you are 100% certain all the necessary modifications have been made. Good luck!

@anandkaranubc anandkaranubc removed the Needs Review A pull request which needs code review. label Feb 16, 2025
@gkbishnoi07
Copy link
Contributor Author

This PR still requires several changes. I have pinpointed the exact areas in my review. You can request another review from me after making those changes. Just ensure that you are 100% certain all the necessary modifications have been made. Good luck!

ok,thanks for review

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 16, 2025
@gkbishnoi07
Copy link
Contributor Author

Hi @anandkaranubc, could you please review these PRs when you have time? I'm eager to contribute more to this repo. Thank you!

@gkbishnoi07
Copy link
Contributor Author

@Planeshifter @kgryte please review this PRs

Copy link
Contributor

@anandkaranubc anandkaranubc left a comment

Choose a reason for hiding this comment

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

Some more changes are needed. The rest looks good!

@anandkaranubc anandkaranubc removed the Needs Review A pull request which needs code review. label Feb 17, 2025
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 17, 2025
@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc please review

Copy link
Contributor

@anandkaranubc anandkaranubc left a comment

Choose a reason for hiding this comment

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

The PR looks ready to be merged. Thanks!

@anandkaranubc anandkaranubc added Ready To Merge A pull request which is ready to be merged. and removed Needs Review A pull request which needs code review. Needs Changes Pull request which needs changes before being merged. labels Feb 17, 2025
@stdlib-bot
Copy link
Contributor

PR Commit Message

bench: refactor random number generation in JS benchmarks for stats/base/dists/logistic #4978

PR-URL: https://github.com/stdlib-js/stdlib/pull/5139
Closes: https://github.com/stdlib-js/stdlib/issues/4978

Co-authored-by: Gopi Kishan <gkishan1kyt@gmail.com>
Reviewed-by: anandkaranubc <anandkaranubc@users.noreply.github.com>

Please review the above commit message and make any necessary adjustments.

@anandkaranubc
Copy link
Contributor

anandkaranubc commented Feb 17, 2025

@gkbishnoi07 Can you also update the title to:

bench: refactor random number generation in JS benchmarks for stats/base/dists/logistic

  • Adding backticks around stats/base/dists/logistic
  • Removing the issue number from the title

After this, you can wait for a maintainer to merge this PR.

@gkbishnoi07
Copy link
Contributor Author

@gkbishnoi07 Can you also update the title to:

bench: refactor random number generation in JS benchmarks for stats/base/dists/logistic

  • Adding backticks around stats/base/dists/logistic
  • Removing the issue number from the title

After this, you can wait for a maintainer to merge this PR.

Yes, sure! Thanks for reviewing my PRs.

@gkbishnoi07 gkbishnoi07 changed the title bench: refactor random number generation in JS benchmarks for stats/base/dists/logistic #4978 bench: refactor random number generation in JS benchmarks for stats/base/dists/logistic Feb 17, 2025
Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

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

@Planeshifter Planeshifter merged commit 0d255bc into stdlib-js:develop Feb 18, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready To Merge A pull request which is ready to be merged. Statistics Issue or pull request related to statistical functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Refactor random number generation in JS benchmarks for stats/base/dists/logistic
4 participants