Files
qelectrotech-source-mirror/sources
Kellermorph 650e318e02 Answer the terminal strip editor without walking the whole strip
The editor asks its model for every cell of every row, over and over
(paint, flags, row height, resize to contents). Three answers used to
cost far more than the little they tell:

- a row was found by walking m_physical_data each time, which made a
  layout O(rows^2 * columns);
- the bridge cells walked to the head of the strip for each neighbour
  of each step, and every step filled the full row data, which reads
  the cables of the whole project (the target column of the terminal
  strip editor);
- without any bridge on the strip, that walk still ran to its end.

Rows are now found through an index filled once with m_physical_data,
the bridge walk steps from row to row and fills only the three fields
it reads (level, bridge, identity), and it is skipped when the strip
has no bridge at all.

Nothing about what the editor shows, edits or saves changes: the model
data, the bridge pixmaps and the strip order are the same, only the
time to answer is not. Measured on a 302 row strip with one bridge
(20 rounds, offscreen, off the UI): all flags 372 ms to 6.6 ms, all
display cells 1195 ms to 31 ms, all decoration 7623 ms to 106 ms
(a bridge cell 251 us to 2.5 us), about 65 times faster overall.

The full test suite passes (121/121).
2026-10-21 17:42:12 +02:00
..
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-10-03 18:09:33 +02:00
2026-01-16 15:24:35 +01:00
2026-04-26 10:48:47 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-10-12 16:02:26 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-17 10:29:13 +02:00
2026-07-17 10:29:13 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00