Rethink data organization
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- data-visualization
Direzione di ricerca
Inizia leggendo l’API attuale di PlotPoints e PlotPoint descritta qui, quindi esamina l’issue correlata #76 e la discussione di sei commenti. Per considerare il lavoro completato, è necessario concordare un approccio per sostituire l’input AoS con slice xs e ys, inclusa la gestione delle lunghezze e la migrazione dell’API con modifiche incompatibili; l’issue non indica file né test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Rust
- Stelle
- 494
- Fork
- 110
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di emilk/egui_plot
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di emilk/egui_plot
Issue simili
-
chat compiler P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
HerringtonDarkholme/hd-lang#2793 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
security-advisory
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MinBZK/regelrecht#2173 ·
-
ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
oxc-project/tsrs#1277 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno