Skip to content

Conversation

pranav-1720
Copy link
Contributor

Resolves #4984

Description

What is the purpose of this pull request?

This pull request:

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

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? This may include screenshots, references, and/or implementation notes.

No.

Checklist

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


@stdlib-js/reviewers

…or Poisson

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@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 8, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Feb 8, 2025

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/poisson/cdf $\color{green}226/226$
$\color{green}+100.00\%$
$\color{green}27/27$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}226/226$
$\color{green}+100.00\%$
stats/base/dists/poisson/ctor $\color{green}442/442$
$\color{green}+100.00\%$
$\color{green}27/27$
$\color{green}+100.00\%$
$\color{green}16/16$
$\color{green}+100.00\%$
$\color{green}442/442$
$\color{green}+100.00\%$
stats/base/dists/poisson/entropy $\color{green}146/146$
$\color{green}+100.00\%$
$\color{green}10/10$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}146/146$
$\color{green}+100.00\%$
stats/base/dists/poisson/kurtosis $\color{green}103/103$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}103/103$
$\color{green}+100.00\%$
stats/base/dists/poisson/logpmf $\color{green}224/224$
$\color{green}+100.00\%$
$\color{green}27/27$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}224/224$
$\color{green}+100.00\%$
stats/base/dists/poisson/mean $\color{green}161/161$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}161/161$
$\color{green}+100.00\%$
stats/base/dists/poisson/median $\color{green}107/107$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}107/107$
$\color{green}+100.00\%$
stats/base/dists/poisson/mgf $\color{green}183/183$
$\color{green}+100.00\%$
$\color{green}13/13$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}183/183$
$\color{green}+100.00\%$
stats/base/dists/poisson/mode $\color{green}104/104$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}104/104$
$\color{green}+100.00\%$
stats/base/dists/poisson/pmf $\color{green}228/228$
$\color{green}+100.00\%$
$\color{green}27/27$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}228/228$
$\color{green}+100.00\%$
stats/base/dists/poisson/quantile $\color{red}368/370$
$\color{green}+99.46\%$
$\color{red}48/49$
$\color{green}+97.96\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{red}368/370$
$\color{green}+99.46\%$
stats/base/dists/poisson/skewness $\color{green}104/104$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}104/104$
$\color{green}+100.00\%$
stats/base/dists/poisson/stdev $\color{green}104/104$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}104/104$
$\color{green}+100.00\%$
stats/base/dists/poisson/variance $\color{green}161/161$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}161/161$
$\color{green}+100.00\%$

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

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.

Looks good, thank you for your first PR!

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Feb 8, 2025
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Feb 8, 2025
@stdlib-bot
Copy link
Contributor

PR Commit Message

bench: refactor random number generation in stats/base/dists/poisson

PR-URL: https://github.com/stdlib-js/stdlib/pull/5106
Ref: https://github.com/stdlib-js/stdlib/issues/4984

Co-authored-by: Pranav Agrawal <[email protected]>
Co-authored-by: pranav-1720 <[email protected]>
Reviewed-by: Philipp Burckhardt <[email protected]>

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

@Planeshifter Planeshifter merged commit 28b78a0 into stdlib-js:develop Feb 8, 2025
27 checks passed
saurabhraghuvanshii pushed a commit to saurabhraghuvanshii/stdlib-gs that referenced this pull request Feb 11, 2025
ShabiShett07 pushed a commit to ShabiShett07/stdlib that referenced this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. 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/poisson

3 participants