Re: Notmuch emacs client is slow when opening inbox.

Subject: Re: Notmuch emacs client is slow when opening inbox.

Date: Mon, 19 Sep 2022 03:12:21 +0100

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: Jose A Ortega Ruiz


On Sun, Sep 18 2022, David Bremner wrote:

> Jose A Ortega Ruiz <mail@jao.io> writes:
>>
>> interesting!  if we were to have this, i think i'd prefer pagination
>> rather than increasing the limit and keeping the old ones, and make it
>> work for tree searches too.  and perhaps the limit (page size) could be
>> a query parameter, so that one could have different page sizes for
>> different queries.  if that makes sense (and i'm not missing a better
>> way already in place), i might try to implement it when i have a bit of
>> time.
>
> Before going to far with pagination, maybe get Jani to recap the
> difficulties he saw at the time that led him to propose the simpler
> approach.
>
> I can think of a few issues, but I don't really know if they are
> blockers.
> - the result set is going to vary dynamically as messages are added and
>   removed from the database
>
> - As far as I can tell, there isn't really an easy way to jump to page
> n of the results.

fwiw, my idea here was to always run the full, non-paginated query, and
populate its result buffer just as now, but show, instead of that
buffer, an indirect buffer pointing to it, narrowed to the page at hand.

in that scenario, one can always compute easily how many pages of output
are available so far, and know whether there are more to come (and ask
the user to wait a bit).  my feeling is that, in most cases, by the time
the user has perused one or two pages, all the results will already be
available and it'll be just a matter of changing narrow regions.

this also avoids the complication that changing tags as one reads
messages would also, in general, change the result set.

not as efficient as a limit/offset query per page, but i think the
bottleneck here is in displaying results rather than running the query
in most cases, isn't it?

jao
-- 
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -Georges W. Bush
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: