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

Merged
merged 3 commits into from
Mar 1, 2025

Conversation

saurabhraghuvanshii
Copy link
Contributor

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • Refactors random number generation in JS benchmark in math/base/special/besselj*

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves none

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

---
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: passed
  - 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: passed
  - 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 Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Feb 23, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Feb 23, 2025

Coverage Report

Package Statements Branches Functions Lines
math/base/special/besselj0 $\color{red}491/501$
$\color{green}+98.00\%$
$\color{red}40/46$
$\color{green}+86.96\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{red}491/501$
$\color{green}+98.00\%$
math/base/special/besselj1 $\color{red}499/507$
$\color{green}+98.42\%$
$\color{red}42/48$
$\color{green}+87.50\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{red}499/507$
$\color{green}+98.42\%$
math/base/special/bessely0 $\color{red}586/599$
$\color{green}+97.83\%$
$\color{red}45/54$
$\color{green}+83.33\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{red}586/599$
$\color{green}+97.83\%$
math/base/special/bessely1 $\color{red}455/463$
$\color{green}+98.27\%$
$\color{red}39/45$
$\color{green}+86.67\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{red}455/463$
$\color{green}+98.27\%$
math/base/special/beta $\color{red}326/339$
$\color{green}+96.17\%$
$\color{red}28/35$
$\color{green}+80.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{red}326/339$
$\color{green}+96.17\%$

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

@anandkaranubc anandkaranubc added the Benchmarks Pull requests adding or improving benchmarks for measuring performance. label Feb 24, 2025
@anandkaranubc
Copy link
Contributor

@saurabhraghuvanshii Thanks for working on this. If you're already covering the functions from the top, I'll start from the bottom to avoid duplicate PRs. 😄

@saurabhraghuvanshii
Copy link
Contributor Author

Yes I am covering from top , thanks

@kgryte kgryte requested a review from anandkaranubc February 25, 2025 22:18
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.

Just some minor changes :)

double y;
double t;
int i;

for ( i = 0; i < 100; i++ ) {
x[ i ] = ( 100000.0 * rand_double() ) - 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
x[ i ] = ( 100000.0 * rand_double() ) - 0.0;
x[ i ] = 100000.0 * rand_double();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so many file have this so can I remove this type things that file too?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's apply this change to the packages we've already refactored. For the remaining packages, we can implement this change along with other refactoring tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

But yes, this type of change is desired in all the upcoming PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Today I do refactor for other files also , I have my end sem exam therefore, I am busy

Copy link
Contributor

Choose a reason for hiding this comment

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

No rush! I don't think this is a high-priority change....

@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 26, 2025
---
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: na
  - 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: passed
  - 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: failed
---
@anandkaranubc anandkaranubc removed the Needs Changes Pull request which needs changes before being merged. label Feb 26, 2025
@anandkaranubc
Copy link
Contributor

@kgryte This should be ready to merge.

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Mar 1, 2025
@stdlib-bot
Copy link
Contributor

PR Commit Message

bench: refactor random number generation

PR-URL: https://github.com/stdlib-js/stdlib/pull/5397

Co-authored-by: Saurabh Singh <[email protected]>
Co-authored-by: saurabhraghuvanshii <[email protected]>
Reviewed-by: Philipp Burckhardt <[email protected]>

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

@Planeshifter Planeshifter merged commit 52c0299 into stdlib-js:develop Mar 1, 2025
26 checks passed
@saurabhraghuvanshii saurabhraghuvanshii deleted the random-refactor branch March 1, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmarks Pull requests adding or improving benchmarks for measuring performance. Math Issue or pull request specific to math functionality. Ready To Merge A pull request which is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants