Commit dc6b9dd
Use faster containers for bulk-populated custom emoji maps
Replace base::flat_map (sorted vector with O(n) insertion) with
std::unordered_map for CustomEmojiManager::_instances and std::map
for EmojiListWidget::_customEmoji. These maps accumulate ~8000
entries during startup with unsorted keys, causing O(n²) total
insertion cost. This change reduces refreshCustom() from ~3s to
~50ms (57x speedup).1 parent f9bf1e9 commit dc6b9dd
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | | - | |
| 443 | + | |
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
0 commit comments