[Perf] Pointer moves: screen-CTM read and interaction-point rebuild on every move, and no early-input option
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- d3, typescript
調査の方向性
Start with packages/charts-core/src/renderer.ts at handlePointerMove, clientToScene, and interactionPoints, then read svg-coordinates.ts and related issue #190 for the strategy API context. The report measures pointer handling and describes two proposed improvements, but implementing them requires decisions about caching invalidation and the public pointer input API. Done means the selected performance and early-input behavior is implemented and verified against the reported interaction and pointer-leave cases.
索引モデルが issue の本文から書いたものです。
説明
Hover cost and hover latency both come from the same move handler.
A. Work per move, even when focus does not change
handlePointerMoveresolves the pointer on every move (renderer.ts:739-753).- That calls
clientToScene, which readsgetScreenCTM()and inverts it (renderer.ts:636-643, svg-coordinates.ts:9-24). After any style write this forces a layout flush. - It then rebuilds
interactionPoints()and runs the strategy (renderer.ts:1169-1191). updateFocusreturns early on an unchanged point only after all of that (renderer.ts:545-555).
Measured in Chrome (radar, 3 polygons, custom focus.resolve, 300 moves inside one polygon, 3 runs): 0.13-0.18 ms per move in the handler. The strategy itself is 0.004-0.011 ms. The same chart drawn with per-polygon mouseenter costs 0.035-0.05 ms.
B. No way to use earlier pointer input
Chrome aligns pointermove to the frame. On a line chart at 1440 px, about 8 ms of the 9.7 ms median from input to the next painted frame is this wait. pointerrawupdate arrives 0.5-2 ms after the input, but the renderer only listens to pointermove. Driving setControlledFocus from it makes the owner 'controlled', so pointer leave no longer clears focus (see the comment on #189).
Proposal
- A: cache the inverse CTM until a resize or scene update, and let a strategy say the pointer is still inside the current focus (for example
contains(x, y)) so the controller skips the rebuild. - B: an option such as
pointerEvent: 'pointermove' | 'pointerrawupdate'(falling back where unsupported), or a public method that applies a pointer sample with the same leave and tooltip handling as the move handler.
Related: #190 (what a strategy can see). Checked against 57774e14a1a86081eddb3a23523724a40da05640 (v1.1.0).
- 主要言語
- TypeScript
- スター
- 870
- フォーク
- 57
- 平均マージ
- 11時間 58分
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/charts のほかの issue
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`対応中かも @getdownandcode が 37 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TanStack/charts#211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add reverse options to waffleY and waffleX対応中かも @tannerlinsley が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
TanStack/charts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fb55/htmlparser2#2579 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue needs-review
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
Add Module DB Rulesオープンdocumentation public
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
midnightntwrk/umbradb#65 ·
メンテナーはふだん 2 日以内に返信
-
area/channels kind/bug priority/medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nanocoai/nanoclaw#4501 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs verification
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 13 日以内に返信