Subject: Re: Slow/buffered output of targets finished messages

From: Sergey Matveev <[email-masked]>
Date: Sat, 23 Sep 2023 22:17:00 +0300

Greetings!

*** spacefrogg [2023-09-21 19:12]:
>3. The output of redo has become useless for larger amounts of targets that
>can run in parallel.

Although I use goredo everyday with projects of at least dozens of
dependencies, they build pretty quickly so I did not notice that
behaviour. I created 1k of targets with sleep 0.1 and indeed I see the
progress bar constantly refreshing, but no "redo" lines appearing until
they all printed at once at the very end.

That was not about buffering, but when goredo make the list of targets
needed to be done, it starts them in a for-loop. runScript() is not a
very quick operation itself. So just running each target takes
relatively considerable amount of time. And only after all of targets
are started, next for-loop starts collecting their results, collecting
either they succeeded or not. When that loop is started, actually most
of the targets can be already done, but the code that prints that
information just was not started at all.

In 1.31.0 release I moved that status-collecting code to a separate
goroutine working in parallel with targets running. Now it will show
success/failure message about the finished target nearly instantly.
Thanks for the report!

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: 12AD 3268 9C66 0D42 6967  FD75 CB82 0563 2107 AD8A