Rethink data organization
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
調査の方向性
まず、ここで説明されている現在の PlotPoints および PlotPoint API を読み、その後、関連する issue #76 と6件のコメントからなる議論を確認してください。完了とするには、AoS 入力を xs および ys スライスに置き換えるための合意された方針が必要です。これには長さの扱いと、破壊的な API 移行を含みます。この issue ではファイルやテストは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
Currently you need to pass PlotPoints resp. Vec<PlotPoint { x, y }> as inputs for plotting. This is called AoS (array-of-structures). AoS is in my humble opinion not as good as SoA.
Reasoning
AoS is inefficient:
- A common use-case for plotting is time-series plots, with shared x-axis. The AoS forces you to make a copy of xs for each line plot, ~doubling memory requirements.
- It does not allow to slice data efficiently, i.e. to manage ranges of data given current plot bounds.
- Poorer cache locality for typical access patterns (e.g. compute min/max for plot bounds)
- It is hard to extend. Some plot items may require more data (i.e. recently colormap) which forces every user of PlotPoint to pass even more data, which may not be used at all, and breaks public API every time.
Better alternative in terms of performance is generally SoA (structure-of-arrays):
- SoA better aligns with SIMD / most graphics APIs and shaders prefer SoA-like layouts.
- Addresses weakness points of AoS.
Disadvantages of SoA:
- xs and ys must have the same length, but this is no longer enforced by the type system - requires runtime checks or truncation.
- Passing two slices is more verbose than a single Vec.
Proposal
Proposal is to get rid of Vec<PlotPoint { x, y }> and instead pass xs: &[f32] and ys: &[f32]).
This would be a major breaking change.
Related PRs/issues
#76
- 主要言語
- Rust
- スター
- 494
- フォーク
- 110
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
emilk/egui_plot のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
emilk/egui_plot の issue をすべて見る
似ている issue
-
chat compiler P1
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
HerringtonDarkholme/hd-lang#2793 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
security-advisory
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MinBZK/regelrecht#2173 ·
-
ci
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
oxc-project/tsrs#1277 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信