Files
craft-libs/crates/keymap/tests
David Mann c78c49e2f7 Menus: collect the Help search's commands only while Help shows; shown chords without allocating
Two costs every frame paid, found in a profile of PhotoCraft on the
framework (storytold/photocraft#15493):

- `MenuBarUi::show` collected the Help search's entries (every row of
  every menu, with English labels) on every pass whenever the bar had a
  Help menu, open or not. `MenuHelp::built` takes a builder the bar runs
  only in a pass that shows the Help menu; `MenuHelp::new` keeps taking a
  ready list.
- `Keymap::shown_chord`, which every menu row, tooltip and button asks
  each pass, built the command's key string for every `find` and ran a
  full `lookup` per binding, cloning the winning commands only to look
  their keys up again. `find` now looks up a command without parameters
  by its id, and `press_runs` decides on catalog positions. Answers are
  unchanged; a new test covers tools sharing a chord (a cycle within a
  group, the first of two groups), which no test covered.

Measured in PhotoCraft (Windows 11, idle machine, three runs, together
with PhotoCraft's own storytold/photocraft#15496): UI pass with a pointer
over the canvas 8.7-11.3 ms -> 4.9-5.0 ms, during a menu hover
9.2-10.2 ms -> 6.7-7.1 ms.

Part of storytold/photocraft#15493.
2026-11-17 21:04:10 +01:00
..