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 stats/base/dists/triangular #5015

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

ahmad-kashkoush
Copy link
Contributor

@ahmad-kashkoush ahmad-kashkoush commented Feb 1, 2025

Resolves #4989

Description

What is the purpose of this pull request?

This pull request:

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

gururaj1512 and others added 2 commits January 31, 2025 17:33
…cial/round`

PR-URL: stdlib-js#4950
Co-authored-by: Athan Reines <[email protected]>
Reviewed-by: Athan Reines <[email protected]>

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: passed
  - task: run_c_examples
    status: failed
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: passed
  - task: run_c_examples
    status: failed
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: passed
  - task: run_c_examples
    status: failed
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: passed
  - task: run_c_examples
    status: failed
---
…king loops

---
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
---
@ahmad-kashkoush ahmad-kashkoush changed the title bench: refactor random number generation in stats/base/dists/triangular feat: refactor random number generation in stats/base/dists/triangular Feb 1, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Feb 1, 2025

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/triangular/cdf $\color{green}271/271$
$\color{green}+100.00\%$
$\color{green}34/34$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}271/271$
$\color{green}+100.00\%$
stats/base/dists/triangular/ctor $\color{red}520/524$
$\color{green}+99.24\%$
$\color{red}56/57$
$\color{green}+98.25\%$
$\color{red}20/21$
$\color{green}+95.24\%$
$\color{red}520/524$
$\color{green}+99.24\%$
stats/base/dists/triangular/entropy $\color{green}206/206$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}206/206$
$\color{green}+100.00\%$
stats/base/dists/triangular/kurtosis $\color{green}205/205$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}205/205$
$\color{green}+100.00\%$
stats/base/dists/triangular/logcdf $\color{green}275/275$
$\color{green}+100.00\%$
$\color{green}34/34$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}275/275$
$\color{green}+100.00\%$
stats/base/dists/triangular/logpdf $\color{green}362/362$
$\color{green}+100.00\%$
$\color{green}39/39$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}362/362$
$\color{green}+100.00\%$
stats/base/dists/triangular/mean $\color{green}189/189$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}189/189$
$\color{green}+100.00\%$
stats/base/dists/triangular/median $\color{red}195/197$
$\color{green}+98.98\%$
$\color{red}12/13$
$\color{green}+92.31\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{red}195/197$
$\color{green}+98.98\%$
stats/base/dists/triangular/mgf $\color{red}344/348$
$\color{green}+98.85\%$
$\color{red}25/27$
$\color{green}+92.59\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{red}344/348$
$\color{green}+98.85\%$
stats/base/dists/triangular/mode $\color{green}189/189$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}189/189$
$\color{green}+100.00\%$
stats/base/dists/triangular/pdf $\color{green}348/348$
$\color{green}+100.00\%$
$\color{green}39/39$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}348/348$
$\color{green}+100.00\%$
stats/base/dists/triangular/quantile $\color{green}273/273$
$\color{green}+100.00\%$
$\color{green}33/33$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}273/273$
$\color{green}+100.00\%$
stats/base/dists/triangular/skewness $\color{green}210/210$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}210/210$
$\color{green}+100.00\%$
stats/base/dists/triangular/stdev $\color{green}206/206$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}206/206$
$\color{green}+100.00\%$
stats/base/dists/triangular/variance $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}11/11$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$

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

…andom

---
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
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Feb 2, 2025
@ahmad-kashkoush
Copy link
Contributor Author

@kgryte Kindly review this issue please, I hope to get a feedback

@anandkaranubc
Copy link
Contributor

anandkaranubc commented Feb 2, 2025

Thanks @ahmad-kashkoush for working on this. Left a few suggestions which will apply throughout the whole PR.

Edit: Can you please change the title to:

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

@ahmad-kashkoush ahmad-kashkoush changed the title feat: refactor random number generation in stats/base/dists/triangular bench: refactor random number generation in stats/base/dists/triangular Feb 3, 2025
@anandkaranubc anandkaranubc added the Needs Changes Pull request which needs changes before being merged. label Feb 3, 2025
ahmad-kashkoush and others added 7 commits February 3, 2025 20:34
…mark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…mark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…mark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…mark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…benchmark/benchmark.native.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…benchmark/benchmark.native.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…benchmark/benchmark.native.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
@ahmad-kashkoush
Copy link
Contributor Author

@anandkaranubc thanks for your help

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 3, 2025
var a;
var b;
var c;
var i;

len = bm.iterations;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same change as above.

bm.fail( 'should return set value' );
}
}
bm.toc();
if ( isnan( y ) ) {
if ( isnan( y[ ( i - 1 ) % len ] ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

@anandkaranubc anandkaranubc removed the Needs Review A pull request which needs code review. label Feb 5, 2025
ahmad-kashkoush and others added 4 commits February 7, 2025 15:15
…mark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…hmark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…hmark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
…hmark/benchmark.js

Co-authored-by: Karan Anand <[email protected]>
Signed-off-by: Ahmed_Kashkoush <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Changes Pull request which needs changes before being 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/triangular
4 participants