git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] progress: replace setitimer() with alarm()

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 23, 2025, 22:03 UTC
Message-ID
<08f405a6-fd2e-40d7-850a-574356b4009e@kdbg.org>
In-Reply-To
<xmqq4itxvi3z.fsf@gitster.g>
Am 23.08.25 um 23:33 schrieb Junio C Hamano:
> Yes, the use of itimer to only change the flag without doing
> anything funky has been a very safe way to use signals, doing only
> absolutely minimal thing in the signal handler.  Having to rearm the
> signal in the signal handler in Carlo's patch made me feel dirtier.

While this is clean on POSIX, it isn't the only platform where Git runs. On Windows, this part of the progress indication is as dirty as it can get. Getting rid of it is a big bonus in my book.

Show 7 quoted lines
> But looking at the wallclock once every iteration of a busy loop?  
> 
> Operating system folks may have worked hard to minimize the cost of
> system calls to gettimeofday() in order to help applications that do
> so, but I somehow feel even dirtier to hear proposal to do so to
> replace a signal that we set and forget, to be reminded once every
> second.

I think that ship has sailed already. Look at display_throughput(). One of the first things it does is to look at the wallclock a.k.a. getnanotime().

That said, I am not very happy about the new calls introduced in display_progress(), either. I'll see whether I can produce some performance measurements.

I observe a behavior change with delayed progress indicators that I have to understand and fix it before I can submit the cleaned up patches.

-- Hannes
Previous: Junio C HamanoNext: Johannes Sixt
Message 9 of 16 in “progress: replace setitimer() with alarm()”
  1. 0/2 progress: replace setitimer() with alarm()Carlo Marcelo Arenas Belón via GitGitGadget, Aug 23, 2025
  2. 1/2 progress: replace setitimer() with alarm()Carlo Marcelo Arenas Belón via GitGitGadget, Aug 23, 2025
  3. 2/2 progress: add a shutting down state to the SIGALRM handlerCarlo Marcelo Arenas Belón via GitGitGadget, Aug 23, 2025
  4. Johannes SixtAug 23, 2025
  5. Carlo Marcelo Arenas BelónAug 23, 2025
  6. Johannes SixtAug 23, 2025
  7. Junio C HamanoAug 23, 2025
  8. Junio C HamanoAug 23, 2025
  9. Johannes SixtAug 23, 2025
  10. progress: pay attention to (customized) delay timeJohannes Sixt, Aug 24, 2025
  11. Junio C HamanoAug 25, 2025
  12. Carlo Marcelo Arenas BelónAug 25, 2025
  13. Junio C HamanoAug 25, 2025
  14. progress: pay attention to (customized) delay timeJohannes Sixt, Aug 25, 2025
  15. Junio C HamanoAug 25, 2025
  16. Junio C HamanoAug 24, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.