Map of huge networks: fiber capacity once per frame, skip links off screen

draw() asked dfCap() three to five times per fiber link and per frame (width,
colour, label, up or down), each time over all its channels: on a save with
3,140 dark fibers of 18 channels on average that was about half of draw()'s
JavaScript. dfCap() now keeps its answers in DFC while one frame is drawn
(cleared in a finally, so a failed frame keeps nothing), and the link label is
built once per line instead of once per world copy. Links entirely above or
below the screen are skipped like those left or right of it already were.

Player save (202 POPs, 3,142 links), jsdom: draw() 40 -> 25 ms; perf-bench
"Map at three zoom levels" 89.7 -> 47.1 ms. Canvas call log identical at
every zoom without the vertical skip; Firefox pixels identical (SHA-1 of the
canvas) in 7 views. Firefox still spends ~95% of the frame painting.
This commit is contained in:
Hugues 2026-10-27 13:44:47 +01:00
parent 97b195dd91
commit ecb862e70d
4 changed files with 35 additions and 6 deletions

View file

@ -6,6 +6,8 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
- The map of a huge network spends less time working out fiber capacities on every frame, and skips links above or below the screen.
## [1.34.1] — 2026-10-27
- The game starts faster in Italian, Portuguese and French: their translations are about 40% smaller to download.