Make big networks fast: routing, panels and map drawing

A network with a hundred POPs and a thousand peering ports froze the game for
most of a second every day and after every click, because routing checked all
~1,800 exits for each of ~14,000 flows. Now:

- compute(): exits are asked once per network which networks they reach, each
  flow scans only those, and the first ECMP group is found without sorting. The
  graph runs on city indices with a typed-array Dijkstra (same heap moves, same
  ties), routers and per-link traffic are kept in typed arrays, the diverse-path
  check reuses one live-link graph, and R.ef is put together when a link is read.
  Results are bit-identical to before.
- Panels and the NOC dashboard are patched in place (morph) instead of being
  rebuilt, so the browser no longer restyles 1,500 rows every tick. Buttons whose
  action changed are swapped out, keeping #44's tap protection.
- The Networks tab works out each IX port's sessions once instead of once per
  network.
- draw() reuses screen-point buffers, a per-frame pair index and cached label
  widths, strokes the dotted fiber line on the path it already has, and uses
  native roundRect: about a third fewer canvas calls per frame, same output.
This commit is contained in:
Frederic Jung 2026-10-26 00:03:05 +01:00
parent 6c2d5da5b8
commit a887b65a2f
5 changed files with 347 additions and 126 deletions

View file

@ -7,6 +7,8 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
- Hamburg and Munich join the map, with the Moin-IX and the Brezn-IX. Stuttgart and Frankfurt are back where they belong on the map, with Stuttgart between Frankfurt and Zurich instead of halfway to Prague.
- Big networks no longer lag: working out each day's traffic is more than ten times faster with a hundred POPs and a thousand peering ports, so the game stops freezing every day and after every click. The map needs about a third fewer drawing steps per frame, and open panels only update what changed, which keeps them smooth and lets the traffic bars glide to their new values.
## [1.28.0] — 2026-10-25
- Belgium and Luxembourg join the map: Brussels, Oostkamp and Bettembourg (#79). Belgian POPs and transit cost more, and Belgian homes stay with their two big ISPs unless you run an ad campaign there. Telenyet, Proxyminus, B.I.G.S., Citrus Belgium and CityMess join the networks, a new cable connects London to Oostkamp through some very busy fishing grounds, and Bettembourg's cooling depends on a steady supply of waste wood.