From: NRK Date: Wed, 23 Mar 2022 20:04:04 +0000 (+0600) Subject: significantly improve performance on large strings X-Git-Url: https://git.xinqibao.xyz/dmenu.git/commitdiff_plain/7269c5355d257dd2ad2c53f15dc9c1cf6796aea5?ds=sidebyside;hp=7269c5355d257dd2ad2c53f15dc9c1cf6796aea5 significantly improve performance on large strings this replaces inefficient pattern of `MIN(TEXTW(..), n)` with drw_fontset_getwidth_clamp() instead, which is far more efficient when we only want up to a certain width. dumping a decently sized (unicode) emoji file into dmenu, I see the startup time drop significantly with this patch. before -> after 360ms -> 160ms this should also noticeably improve input latency (responsiveness) given that calcoffsets() and drawmenu() are pretty hot functions. ---