Skip to content

bench: refactor random number generation in JS benchmarks for stats/base/dists/pareto-type1 #5260

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

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

gkbishnoi07
Copy link
Contributor

Resolves #4982

Description

What is the purpose of this pull request?

This pull request:

  • Refactors random number generation in JS benchmarks for stats/base/dists/pareto-type1.
  • 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. Needs Review A pull request which needs code review. labels Feb 17, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Feb 17, 2025

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/pareto-type1/cdf $\color{green}239/239$
$\color{green}+100.00\%$
$\color{green}23/23$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}239/239$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/ctor $\color{green}438/438$
$\color{green}+100.00\%$
$\color{green}32/32$
$\color{green}+100.00\%$
$\color{green}17/17$
$\color{green}+100.00\%$
$\color{green}438/438$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/entropy $\color{green}126/126$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}126/126$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/kurtosis $\color{green}128/128$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}128/128$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/logcdf $\color{green}243/243$
$\color{green}+100.00\%$
$\color{green}23/23$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}243/243$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/logpdf $\color{green}251/251$
$\color{green}+100.00\%$
$\color{green}23/23$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}251/251$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/mean $\color{green}122/122$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}122/122$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/median $\color{green}119/119$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}119/119$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/mode $\color{green}124/124$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}124/124$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/pdf $\color{green}251/251$
$\color{green}+100.00\%$
$\color{green}23/23$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}251/251$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/quantile $\color{green}235/235$
$\color{green}+100.00\%$
$\color{green}23/23$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}235/235$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/skewness $\color{green}196/196$
$\color{green}+100.00\%$
$\color{green}10/10$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}196/196$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/stdev $\color{green}203/203$
$\color{green}+100.00\%$
$\color{green}12/12$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}203/203$
$\color{green}+100.00\%$
stats/base/dists/pareto-type1/variance $\color{green}129/129$
$\color{green}+100.00\%$
$\color{green}10/10$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}129/129$
$\color{green}+100.00\%$

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

@gkbishnoi07
Copy link
Contributor Author

@anandkaranubc ready for review

@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 required. The rest looks good!

@anandkaranubc anandkaranubc added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels 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

@gkbishnoi07 gkbishnoi07 changed the title bench: refactor random number generation in JS benchmarks for stats/base/dists/pareto-type1 bench: refactor random number generation in JS benchmarks for stats/base/dists/pareto-type1 Feb 17, 2025
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 for your work on this! Now, you can wait for a maintainer to merge it.

@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/pareto-type1`

PR-URL: https://github.com/stdlib-js/stdlib/pull/5260
Closes: https://github.com/stdlib-js/stdlib/issues/4982

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.

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.

Thanks @gkbishnoi07 for your contribution and @anandkaranubc for review! Landing...

@Planeshifter Planeshifter merged commit 4d79bde 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/pareto-type1
4 participants