Skip the key and node maps on single-row list edits?

Aperta
#4,694 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

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
Da chiarire
Stato di attività
Attiva
Stack tecnologico
javascript, typescript

Direzione di ricerca

The issue names reconcileArrays, mapArray, and flatten, but gives no file paths or test names. Read those implementations and the existing list reconciliation tests, then check the reported size gate and benchmark setup. Done means maintainers decide which optimizations, if any, merit a PR and resolve the duplicate-key and moved-node behavior questions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

On 500-row keyed lists, moving one row takes about 100 µs, against about 25 µs to remove one, because reconcileArrays and mapArray each build a map that a two-pointer walk doesn't need. I have a prototype that skips them for end moves, swaps and order-keeping removals, plus a flatten fast path. Is any of it worth a PR?

Solid-only A/B on the Octane fork, 3 rounds on a machine that wasn't idle, so this needs a clean board run:

Suite Reconcile only All three
js-framework-reorder −9.3% −15.6%
js-framework −4.2% −5.4% (swap −52%)
uibench −2.3% −7.9% (one-row moves −59%)
Brotli on js-framework +65 B +240 B

The existing suites pass, but I haven't written new specs. All three changes fail the size gate, at about +850 B minified on app scenarios.

Questions:

  1. Which of these would justify a size exception, if any?
  2. stageEnds pairs duplicate keys by position, so row-local state can land on a different duplicate. Should it decline that case?
  3. With the reconcile change, a node that user code moved out of the list can stay out where next pulls it back. Is that acceptable?
Lingua principale
TypeScript
Stelle
36.2k
Fork
1.1k
Merge medio
9h 58m
PR unite (30g)
474

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid

Tutte le issue di solidjs/solid

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.