Repository navigation
perf(data): opening a file looks up its code's shift only for a note that needs it (#1227) - #3008
Conversation
…that needs it (opengeos#1227) The note on a WGS 84 shift a definition gives but RustGIS can't apply named the EPSG code whose own shift is used in its place. That code was worked out before looking for such a shift, and finding a code's shift lists the whole EPSG catalog the first time: about 60 ms, most of what opening a small GeoPackage took. It is now worked out only when there is a shift to say.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai review |
Action not completed
|
Code reviewBugs: None found. Confidence: high (about 90%). I could not compile or run the tests here, so this rests on reading the code.
Security: None found. Confidence: high. The change is pure computation with no input handling added. Performance: The change does what it claims: the EPSG catalog lookup is skipped when no unapplied shift needs a note. Confidence: medium-high. I could not run the timings. A note that does need a code still pays for Quality: One nit, left for the release quality pass. The existing tests pin the note text in both forms, but nothing asserts that the code lookup is skipped on clean input. A test could check that. Confidence: high that this is a nit, not a defect. Formatting is within AGENTS.md: No rule break found. Confidence: high. There are no Prior concerns: 0 threads existed on this PR, so none were left alone. Inline comments: None posted. The only item is the nit above, which belongs in the release quality pass. Change sizeCompared with main (merge base dde41e0 to PR head 2f30c1d). Sizes are file sizes, not line counts.
|
📖 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 |
|
@coderabbitai review |
Action not completed
|
|
@coderabbitai review |
Action performed
|
Summary
A profile of the benchmark's
render_viewtask showed that opening the GeoPackage spent about a third of a small run's time on a note it then didn't give. The note says that a WGS 84 shift a definition gives can't be applied, and names the EPSG code whose own shift is used in its place.dropped_noteworked that code out (code_with_shift) before it looked for such a shift. The first time it runs, finding a code's shift lists the whole EPSG catalog (epsg_catalog_codes), about 33 ms on a quiet box.dropped_note_bynow takes the code as a closure and calls it only when there is a shift to report. The notes are worded exactly as before.Output
The PNGs from the cases below are byte-identical to
main's.Timing
Runs alternated
main(dde41e0) and this branch, 9 runs each after a warm-up, through the host queue at a load average of about 7. Medians:mainwall / CPUrender_view, 19,283 buildings (tier S)render_view, 100,000 buildings (tier GA, loaded)render_view, the same file streamedrender_viewaddspolygons.gpkg, zooms to[-86.82, 36.13, -86.74, 36.19]on a blank basemap and runsshare.exportMapat 1600 × 900.Where the 100,000-building view's time goes now, from a profile:
A layer in a projected system still lists the catalog once, because
catalog_proj4checks a code's membership that way. Opening a UTM GeoPackage went from about 0.07 s to 0.05 s of CPU. That's a separate change.Surfaces
The change is in
rustgis-data, where every definition with a shift is read: GeoPackage, FileGDB, Zarr and LiDAR coordinate systems, and a system typed into a command. So it reaches the desktop app, the browser, the command line, Python and the phone alike. Nothing saved changes, and nothing new is held.Testing
EPSG:23031's own shift (source::tests), FileGDB's with an ESRI code, LiDAR's and Zarr's with no code. That is 281rustgis-datatests filtered on those modules, and theraster::wkttests.cargo fmt --all --checkand the private preflight passed.UI evidence
No visible UI change.
Related issue
Part of #1227.
Summary by CodeRabbit