[RFC]: Improve sorted arrays generation in C benchmarks for sorted-input packages

オープン
#10,415 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #10705 @pranavthakur-x による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
c
領域
performance

調査の方向性

まず、一覧にあるベンチマークパッケージ stats/strided/*sorted、特に dmediansorted、dmaxsorted、dminsorted、smediansorted、smaxsorted、sminsorted を確認し、それらで既存の rand_double() と time.h がどのように使用されているかを確認します。絶対的にソートされた入力用のパッケージを含めるかどうかを決定します。完了とは、合意した生成方法が対象となるすべてのベンチマークに一貫して適用されるか、使用されていない乱数サポートが削除されることを意味します。

索引モデルが issue の本文から書いたものです。

説明

Description

This RFC proposes to generalize the generation of random arrays in C benchmarks for sorted-input packages. It mainly tries to add a random factor for the generated values and make use of the already existing rand_double() function and time.h header for consistency between packages.

For example, for double precision packages, to be changed from: (e.g., from stats/base/strided/dminsorted)

x = (double *) malloc( len * sizeof( double ) );
for ( i = 0; i < len; i++ ) {
	x[ i ] = i;
}

To:

x = (double *) malloc( len * sizeof( double ) );
for ( i = 0; i < len; i++ ) {
    x[ i ] = (double)i + rand_double();
}

Packages that are directly affected by this (add more if found):

  • stats/strided/dmediansorted
  • stats/strided/dmaxsorted
  • stats/strided/dminsorted
  • stats/strided/smediansorted
  • stats/strided/smaxsorted
  • stats/strided/sminsorted
Related Issues

None.

Questions
Question 1

I suggest that we either enforce this or refactor the already existing packages that don't use any randomness by removing the time.h header and rand_double() function since they're not used anywhere in the benchmark.

Question 2

What about the absolute sorted-input packages? Current approach is: (from stats/base/strided/dmaxabssorted)

x = (double *) malloc( len * sizeof( double ) );
for ( i = 0; i < len; i++ ) {
		x[ i ] = i - (len/2);
	}
Other

No.

Checklist
  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
主要言語
JavaScript
スター
6k
フォーク
1.3k
平均マージ
1日 21時間
マージ済み PR(30日)
224

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stdlib-js/stdlib のほかの issue

stdlib-js/stdlib の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。