Closed yshavit closed 2 years ago
Some numbers:
Load the options | Open the popup | Type a char | Delete a char | |
---|---|---|---|---|
Before | 4.3 seconds | ~7 seconds¹ | ~3 seconds | ~9 seconds³ |
After | 0.15 seconds | milliseconds² | milliseconds² | milliseconds² |
1. I couldn't figure out how to time the UI elements; even when I enqueue a work item using DispatchQueue.async
with a QoS of userInteractive
, the timer completes well before the actual change appears on the UI. So, I'm manually starting a stopwatch to time it, and it's thus subject to my thumb reaction time. Any column marked with "~" is approximate because of this.
2. Using the stopwatch method described above, these were basically all "noticeable, but too fast for me to time."
3. Deleting a char takes longer than typing one, because it means that by the end of the action, there are more options visisble.
This rewrite puts all of the options into a single text view, instead of having each one as a separate NSView. The result is at least a couple orders of magnitude difference; I'll do some benchmarking in a bit.
The old implementation made the ⌘F find feature borderline unusable because of how slow it was. Now it won't quite be snappy, but it'll at least be usable.