Repository navigation
perf(tiles): fill a window's gaps a tile at a time while its tiles load - #3547
Conversation
While a raster read in place waits for its tiles, the other levels kept stand in for them. Each missing pixel looked its tile up at every other level, also at levels with nothing kept, at every redraw. A level's tile is now looked up once for the run of pixels in it, and passed over whole when it isn't kept. The picture is the same. Part of opengeos#2761.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewReviewed Bugs: None found. I checked these paths and they hold:
Security: None found. Hostile header values are handled as before: Performance: No concerns. The change removes the per-pixel lookup and clone. The new per-gap Quality: Nothing worth posting inline. The new test's doc comment and the AGENTS.md: No violations found in the changed lines.
Twins: The PR changes only the Confidence: High that the change is correct as written. Medium-high on the test passing, since I could not run it. Already raised earlier: 0. Change sizeCompared with main (merge base def6c67 to PR head ff02e11).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
While a raster read in place waits for its tiles, the other levels kept stand in for them (
stand_in). Every missing pixel looked its tile up at every other level, in every band, at each redraw, even at levels with nothing kept. On a 2560 × 1440 view of a 10.6 GB file, more than half of the draw was spent there, though the tiles themselves had arrived in the first 0.3 s.Each row of a gap is now split into the runs of pixels that share a tile of the other level. A tile is looked up once a run, and a run whose tile isn't kept is passed over whole. The picture is the same: a pixel's place in the other level is worked out as before, and no-data, short tiles and which level fills a pixel behave as they did.
Not in this PR: redraws as tiles land still run on the UI thread on a map without tile layers, and the window is still assembled whole each time. Both are later steps of #2761.
Surfaces: every one that draws a raster read in place (desktop, browser, command line, Python, phone). No command, parameter, saved format or undo step changes. Memory: one
u32a column of the gap being filled.Testing
stand_ins_take_each_pixel_from_the_nearest_level_kept: 3 windows × 40 patterns of kept tiles, levels that don't halve evenly and tiles of different sizes, each pixel against a lookup of its own.share.exportMapof a local 83517 × 78739 LZW file, three runs each, v0.9.0 against this branch, on a busy machine, seconds:The PNGs were byte for byte the same in all six. The last fix of review (a tile shorter than its header says) came after these runs.
UI evidence
No visible UI change.
Related issue
Part of #2761.
Summary by CodeRabbit