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

Re: "meson test" very slow on Windows

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 2, 2025, 23:13 UTC
Message-ID
<Z5_8MuRxJKZm2bdH@tapette.crustytoothpaste.net>
In-Reply-To
<CAGJzqsmo988VwABNgozwQEKBe-nyfw9f2G2obygqs8OtuYpeiQ@mail.gmail.com>
On 2025-02-02 at 21:45:34, M Hickford wrote:
Show 18 quoted lines
> On Sun, 2 Feb 2025 at 07:46, Johannes Sixt <j6t@kdbg.org> wrote:
> >
> > Am 01.02.25 um 23:56 schrieb M Hickford:
> > > Hi. Has anyone else found that "meson test" is very slow on Windows? I
> > > built Git using "meson compile" with compiler MSVC and backend ninja.
> >
> > The tests are very slow on Windows in general. Please clarify: when you
> > say "very slow on Windows with meson", do you then mean "slower than
> > with a Makefile build"?
> 
> Thanks, I didn't know about that. This is my first time I've
> successfully built Git on Windows, so I can't compare build systems.
> (Makefile and CMake never worked for me.)
> 
> Out of curiosity, why are the integration tests so much slower on
> Windows than Linux? Is it the 10+ ms overhead of creating each new
> process? https://stackoverflow.com/q/47845/284795
> https://stackoverflow.com/questions/10710912/what-is-the-process-creation-overhead-in-windows

Our tests are primarily written in shell, which does a lot of fork and exec. These are native to and highly optimized on Unix, but Windows doesn't have this functionality natively for Win32 programs and the emulation is slow. Part of that is because the Cygwin-based libc actually has to emulate it nearly perfectly for software to work. While a partial emulation might work in _some_ cases, it would break in others, so a lot of care and expense has to be provided in making it work just so.

Windows _does_ have this functionality in the kernel and it is reasonably performant, but it's only available in the Linux subsystem and not in the Win32 subsystem. The tests will probably be much faster if you use WSL, although that wouldn't allow you to build a Windows binary.

Dscho and others put a lot of effort into porting shell programs into C to make them more performant on Windows (and elsewhere), since this has been a problem for a long time.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: M Hickford
Message 5 of 5 in “"meson test" very slow on Windows”
  1. M HickfordFeb 1, 2025
  2. Johannes SixtFeb 2, 2025
  3. Patrick SteinhardtFeb 2, 2025
  4. M HickfordFeb 2, 2025
  5. brian m. carlsonFeb 2, 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.