Skip to content

bench: fix data generation in blas/ext/base sort benchmarks - #15512

Merged
kgryte merged 1 commit into
stdlib-js:developfrom
0PrashantYadav0:bench/sort-benchmark-data
Sep 25, 2026
Merged

kgryte merged 1 commit into
stdlib-js:developfrom
0PrashantYadav0:bench/sort-benchmark-data

Conversation

@0PrashantYadav0

Copy link
Copy Markdown
Member

Resolves None.

Description

What is the purpose of this pull request?

This pull request:

  • fixes the rev_sorted_few_uniques benchmarks in the blas/ext/base/*sort* packages, which tested the outer loop counter (i % M) instead of the element index, so the generated arrays were never few-uniques
  • uses len instead of iter in the rev_sorted_random benchmarks so the reverse-sorted data mirrors the sorted case

Related Issues

Does this pull request have any related issues?

No related issues.

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.

---
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: skipped
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - 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: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@0PrashantYadav0
0PrashantYadav0 requested a review from a team September 24, 2026 17:36
@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Review A pull request which needs code review. labels Sep 24, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/dsort2hp $\\color{green}639/639$
$\\color{green}+100.00\\%$
$\\color{green}67/67$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}639/639$
$\\color{green}+100.00\\%$
blas/ext/base/dsort2ins $\\color{green}666/666$
$\\color{green}+100.00\\%$
$\\color{green}74/74$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}666/666$
$\\color{green}+100.00\\%$
blas/ext/base/dsort2sh $\\color{green}551/551$
$\\color{green}+100.00\\%$
$\\color{green}53/53$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}551/551$
$\\color{green}+100.00\\%$
blas/ext/base/dsorthp $\\color{green}461/461$
$\\color{green}+100.00\\%$
$\\color{green}36/36$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}461/461$
$\\color{green}+100.00\\%$
blas/ext/base/dsortins $\\color{green}443/443$
$\\color{green}+100.00\\%$
$\\color{green}41/41$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}443/443$
$\\color{green}+100.00\\%$
blas/ext/base/dsortsh $\\color{green}477/477$
$\\color{green}+100.00\\%$
$\\color{green}49/49$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}477/477$
$\\color{green}+100.00\\%$
blas/ext/base/gsort2hp $\\color{green}498/498$
$\\color{green}+100.00\\%$
$\\color{green}52/52$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}498/498$
$\\color{green}+100.00\\%$
blas/ext/base/gsort2ins $\\color{green}527/527$
$\\color{green}+100.00\\%$
$\\color{green}62/62$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}527/527$
$\\color{green}+100.00\\%$
blas/ext/base/gsort2sh $\\color{green}408/408$
$\\color{green}+100.00\\%$
$\\color{green}37/37$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}408/408$
$\\color{green}+100.00\\%$
blas/ext/base/gsorthp $\\color{green}430/430$
$\\color{green}+100.00\\%$
$\\color{green}51/51$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}430/430$
$\\color{green}+100.00\\%$
blas/ext/base/gsorthp-by $\\color{green}473/473$
$\\color{green}+100.00\\%$
$\\color{green}37/37$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}473/473$
$\\color{green}+100.00\\%$
blas/ext/base/gsortins $\\color{green}419/419$
$\\color{green}+100.00\\%$
$\\color{green}61/61$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}419/419$
$\\color{green}+100.00\\%$
blas/ext/base/gsortsh $\\color{green}348/348$
$\\color{green}+100.00\\%$
$\\color{green}36/36$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}348/348$
$\\color{green}+100.00\\%$
blas/ext/base/ssort2hp $\\color{green}639/639$
$\\color{green}+100.00\\%$
$\\color{green}67/67$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}639/639$
$\\color{green}+100.00\\%$
blas/ext/base/ssort2ins $\\color{green}521/521$
$\\color{green}+100.00\\%$
$\\color{green}41/41$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}521/521$
$\\color{green}+100.00\\%$
blas/ext/base/ssort2sh $\\color{green}551/551$
$\\color{green}+100.00\\%$
$\\color{green}53/53$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}551/551$
$\\color{green}+100.00\\%$
blas/ext/base/ssorthp $\\color{green}461/461$
$\\color{green}+100.00\\%$
$\\color{green}36/36$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}461/461$
$\\color{green}+100.00\\%$
blas/ext/base/ssortins $\\color{green}543/543$
$\\color{green}+100.00\\%$
$\\color{green}69/69$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}543/543$
$\\color{green}+100.00\\%$
blas/ext/base/ssortsh $\\color{green}477/477$
$\\color{green}+100.00\\%$
$\\color{green}49/49$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}477/477$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added the Benchmarks Pull requests adding or improving benchmarks for measuring performance. label Sep 25, 2026

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks for the clean-up, @0PrashantYadav0!

@kgryte

kgryte commented Sep 25, 2026

Copy link
Copy Markdown
Member

As the CI failure is expected, I'll go ahead and merge.

@kgryte
kgryte merged commit 66f69b6 into stdlib-js:develop Sep 25, 2026
64 of 65 checks passed
@kgryte kgryte added review: 5 and removed Needs Review A pull request which needs code review. labels Sep 25, 2026
@Planeshifter Planeshifter mentioned this pull request Sep 25, 2026
5 of 7 tasks
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. BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). review: 5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants