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

已关闭
#4,694 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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?
主要语言
TypeScript
星标
36.2k
派生
1.1k
平均合并
9 小时
30 天内合并 PR
463

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

solidjs/solid 的其他 Issue

查看 solidjs/solid 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。