Consider further speeding up division by `const`-generic specialization.
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- performance
調査の方向性
ieee::sig::div の任意精度除算実装から調査を始め、既存の "from decimal" ベンチマークが関連するケースをカバーしているか確認してください。実装を変更する前にベンチマークを追加し、その後、よく使われる除数に対する const-generic 特殊化を評価してください。除算の動作が維持され、ベンチマークで意味のある高速化が示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The main implementation of the ieee::sig::div "arbitrary-precision division" function could be made into a separate function with a const SPECIALIZE_FOR_KNOWN_DIVISOR: u128 const-generic parameter, which it would use as such:
// The parameter being `0` is like `None` - could use `Option<NonZeroU128>` in the future.
if SPECIALIZE_FOR_KNOWN_DIVISOR != 0 {
assert_eq!(divisor[0], SPECIALIZE_FOR_KNOWN_DIVISOR);
assert!(is_all_zeros(&divisor[1..]));
}
(Hopefully this is enough for the rest of the body to be specialized by LLVM, but it can be further forced if necessary)
Then ieee::sig::div would become a "dispatch" fn, which invokes N+1 different instantiations of the const-generic implementation, for N "commonly used divisors" (10 comes to mind, tho there may be a whole sequence of powers of 5 for the conversion from decimal strings IIRC), and one 0 instantiation (which isn't specialized at all), and because the code still does the same division, we're only relying on the optimizer to actually turn the divisions into multiplications.
Whatever we do to the division algorithm, we shouldn't forget to add benchmarks first (unless the "from decimal" benchmark would cover enough interesting cases).
- 主要言語
- Rust
- スター
- 23
- フォーク
- 18
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rustc_apfloat のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
rust-lang/rustc_apfloat#44 · コメント 3 件 ·
-
Overflow flag when result is larget finite value対応中かも @Garfield1002 が 48 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
rust-lang/rustc_apfloat#36 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rust-lang/rustc_apfloat#46 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
rust-lang/rustc_apfloat#20 ·
-
Support squareRootオープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-lang/rustc_apfloat#14 · コメント 1 件 ·
rust-lang/rustc_apfloat の issue をすべて見る
似ている issue
-
Make major, minor, and makedev safe on solarish targets対応中かも @xtqqczze が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and space対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 3 日以内に返信
-
sncast panics when decoding a `u384` value対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
foundry-rs/starknet-foundry#4635 ·
メンテナーはふだん 3 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
crmne/omastats#31 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:desktop priority:p2 type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信