From: Stefan Sperling Subject: Re: tog log & got-read-pack on the fly: To: Martin Pieuchot Cc: gameoftrees@openbsd.org Date: Thu, 10 Oct 2019 15:54:12 +0200 On Thu, Oct 10, 2019 at 01:46:49PM +0200, Martin Pieuchot wrote: > Diff below makes tog(1) freeze as soon as it tries to go beyond the > first page. Nothing seems to be fetched before that. The top bar keeps > displaying: > > commit ........................................ /sys [46/49] searching... > > Pressing 'n' doesn't refresh the view. That is very strange, it is work just fine here. :-/ > > diff d59c0cb27bc304bc11f9b1094c6eb85f248c7c5f /home/stsp/src/got > > blob - aad8017a1963e96977883c2dadfcef0fce8eac58 > > file + tog/tog.c > > --- tog/tog.c > > +++ tog/tog.c > > @@ -1827,9 +1827,11 @@ search_next_log_view(struct tog_view *view) > > * Poke the log thread for more commits and return, > > * allowing the main loop to make progress. Search > > * will resume at s->search_entry once we come back. > > + * Prefetch a certain number of commits to hopefully > > + * avoid stalling every time the user hits the 'n' key. > > */ > > - s->thread_args.commits_needed++; > > - return trigger_log_thread(1, > > + s->thread_args.commits_needed += 100; > > + return trigger_log_thread(0, > > &s->thread_args.commits_needed, > > &s->thread_args.log_complete, > > &s->thread_args.need_commits); > > > > >