summaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-03-24 00:37:55 +0600
committerrafa_99 <raroma09@gmail.com>2022-03-25 23:12:53 +0000
commit3daa17ff1381f83ecdd143da817bc931423dfc80 (patch)
treef78010861362555d8a572775de9fa04c9a048351 /dmenu.c
parent38540c552941c3a348605d046cf27606afd5de98 (diff)
drw_text: improve performance when there's no match
this was the last piece of the puzzle, the case where we can't find any font to draw the codepoint. in such cases, we use XftFontMatch() which is INSANELY slow. but that's not the real problem. the real problem was we were continuously trying to match the same thing over and over again. this patch introduces a small cache, which keeps track a couple codepoints for which we know we won't find any matches. with this, i can dump lots of emojies into dmenu where some of them don't have any matching font, and still not have dmenu lag insanely or FREEZE completely when scrolling up and down. this also improves startup time, which will of course depend on the system and all installed fonts; but on my system and test case i see the following startup time drop: before -> after 60ms -> 34ms
Diffstat (limited to 'dmenu.c')
0 files changed, 0 insertions, 0 deletions