Re: [hackers] [dmenu|libsl][PATCH] optimize drw_text() for large strings

From: NRK <nrk_AT_disroot.org>
Date: Mon, 21 Mar 2022 14:06:30 +0600

On Sun, Mar 20, 2022 at 02:56:33PM +0100, Stein Gunnar Bakkeby wrote:
> I have attached the changes I was experimenting with.
> I still don't like the amount of effort required for drawing an ellipsis
> though so I attached another patch file that doesn't try to draw the
> ellipsis for comparison.
>
> -Stein

Hi Bakkeby,

I haven't looked too deeply into the patch, but I see that you've moved
the ew calculation inside the first loop rather than looping through
again later down. This was more or less what I was planning to do as
well, although I was motivated by performance reasons, while you seemed
to be motivated by correctness reasons.

Anyhow, it's a good thing that you've sent this mail as it would prevent
some duplicated work on my end.

As for your patch, I think it (just using a single loop instead of two)
is a better approach than the one I sent, although the `ellipsis_width`
shenanigan a bit questionable; I wonder if there's a cleaner way to do
it.

Anyhow, your patch also solves the performance problem with large
strings on my end, and additionally I'm also seeing some startup time
improvement when dumping large non-ascii strings into dmenu.

- NRK
Received on Mon Mar 21 2022 - 09:06:30 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 21 2022 - 09:12:41 CET