{"thread":{"id":"62891","subject":"\"meson test\" very slow on Windows","startedAt":"2025-02-01T22:57:34Z","lastAt":"2025-02-02T23:13:57Z","messageCount":5,"participants":["M Hickford","Johannes Sixt","Patrick Steinhardt","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"511649","messageId":"CAGJzqsmmq1R9_q=p_AsuFMFr3UzyQ4H186CpfWTnCoAnHu_OXA@mail.gmail.com","threadId":"62891","inReplyTo":null,"subject":"\"meson test\" very slow on Windows","fromName":"M Hickford","fromEmail":"mirth.hickford@gmail.com","sentAt":"2025-02-01T22:56:53Z","receivedAt":"2025-02-01T22:57:34Z","isPatch":false,"sender":{"key":"mirth.hickford@gmail.com","avatar":"https://avatars.githubusercontent.com/u/105314?v=4"},"body":"Hi. Has anyone else found that \"meson test\" is very slow on Windows? I\nbuilt Git using \"meson compile\" with compiler MSVC and backend ninja.\n\nCuriously the first few tests were fast. Test 20 (exact number varies)\nand later were slow:\n\n   1/1029 unit-tests                                               OK\n            2.11s\n   2/1029 t-example-decorate                                       OK\n            1.45s\n   3/1029 t-hash                                                   OK\n            1.32s\n   4/1029 t-hashmap                                                OK\n            1.24s\n   5/1029 t-mem-pool                                               OK\n            1.16s\n   6/1029 t-oid-array                                              OK\n            1.10s\n   7/1029 t-oidmap                                                 OK\n            1.05s\n   8/1029 t-oidtree                                                OK\n            0.98s\n   9/1029 t-prio-queue                                             OK\n            0.94s\n  10/1029 t-reftable-basics                                        OK\n            0.89s\n  11/1029 t-reftable-block                                         OK\n            0.83s\n  12/1029 t-reftable-merged                                        OK\n            0.77s\n  13/1029 t-reftable-pq                                            OK\n            0.72s\n  14/1029 t-reftable-reader                                        OK\n            0.64s\n  15/1029 t-reftable-readwrite                                     OK\n            0.54s\n  16/1029 t-reftable-record                                        OK\n            0.45s\n  17/1029 t-reftable-tree                                          OK\n            0.29s\n  18/1029 t-strbuf                                                 OK\n            0.20s\n  19/1029 t-strcmp-offset                                          OK\n            0.51s\n  20/1029 t-trailer                                                OK\n            5.40s\n  21/1029 t-urlmatch-normalization                                 OK\n            5.32s\n  22/1029 t-reftable-stack                                         OK\n           17.67s\n  23/1029 t0013-sha1dc                                             OK\n           42.50s\n  24/1029 t0004-unwritable                                         OK\n           46.87s\n  25/1029 t0022-crlf-rename                                        OK\n           43.77s\n  26/1029 t0014-alias                                              OK\n           49.05s\n  27/1029 t0023-crlf-am                                            OK\n           32.28s\n  28/1029 t0005-signals                                            OK\n           49.83s\n  29/1029 t0018-advice                                             OK\n           58.71s\n  30/1029 t0010-racy-git                                           OK\n           64.75s\n\nOn Linux, all tests were fast as expected.\n\nI built at commit 58b5801aa9 (The sixth batch, 2025-01-31)\n\nAny ideas?\n"},{"id":"511653","messageId":"89612095-6b10-44a1-a29c-b143d67ce7da@kdbg.org","threadId":"62891","inReplyTo":"CAGJzqsmmq1R9_q=p_AsuFMFr3UzyQ4H186CpfWTnCoAnHu_OXA@mail.gmail.com","subject":"Re: \"meson test\" very slow on Windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-02-02T07:46:46Z","receivedAt":"2025-02-02T07:46:55Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 01.02.25 um 23:56 schrieb M Hickford:\n> Hi. Has anyone else found that \"meson test\" is very slow on Windows? I\n> built Git using \"meson compile\" with compiler MSVC and backend ninja.\n\nThe tests are very slow on Windows in general. Please clarify: when you\nsay \"very slow on Windows with meson\", do you then mean \"slower than\nwith a Makefile build\"?\n\n-- Hannes\n\n"},{"id":"511656","messageId":"Z59TzBKLHQJwXUBJ@pks.im","threadId":"62891","inReplyTo":"89612095-6b10-44a1-a29c-b143d67ce7da@kdbg.org","subject":"Re: \"meson test\" very slow on Windows","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-02-02T11:15:24Z","receivedAt":"2025-02-02T11:15:31Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Feb 02, 2025 at 08:46:46AM +0100, Johannes Sixt wrote:\n> Am 01.02.25 um 23:56 schrieb M Hickford:\n> > Hi. Has anyone else found that \"meson test\" is very slow on Windows? I\n> > built Git using \"meson compile\" with compiler MSVC and backend ninja.\n> \n> The tests are very slow on Windows in general.\n\nYeah, it's an unfortunate reality that tests are slow on Windows. It was\nalso mentioned that the first ~20 tests are fast. This is expected,\nbecause the unit tests execute first, and these are way faster compared\nto the integration tests.\n\n> Please clarify: when you say \"very slow on Windows with meson\", do you\n> then mean \"slower than with a Makefile build\"?\n\nJudging from my own tests there is no significant difference between the\ntwo build systems. But in case there is I'd be happy to learn about it.\n\nPatrick\n"},{"id":"511664","messageId":"CAGJzqsmo988VwABNgozwQEKBe-nyfw9f2G2obygqs8OtuYpeiQ@mail.gmail.com","threadId":"62891","inReplyTo":"89612095-6b10-44a1-a29c-b143d67ce7da@kdbg.org","subject":"Re: \"meson test\" very slow on Windows","fromName":"M Hickford","fromEmail":"mirth.hickford@gmail.com","sentAt":"2025-02-02T21:45:34Z","receivedAt":"2025-02-02T21:46:12Z","isPatch":false,"sender":{"key":"mirth.hickford@gmail.com","avatar":"https://avatars.githubusercontent.com/u/105314?v=4"},"body":"On Sun, 2 Feb 2025 at 07:46, Johannes Sixt <j6t@kdbg.org> wrote:\n>\n> Am 01.02.25 um 23:56 schrieb M Hickford:\n> > Hi. Has anyone else found that \"meson test\" is very slow on Windows? I\n> > built Git using \"meson compile\" with compiler MSVC and backend ninja.\n>\n> The tests are very slow on Windows in general. Please clarify: when you\n> say \"very slow on Windows with meson\", do you then mean \"slower than\n> with a Makefile build\"?\n\nThanks, I didn't know about that. This is my first time I've\nsuccessfully built Git on Windows, so I can't compare build systems.\n(Makefile and CMake never worked for me.)\n\nOut of curiosity, why are the integration tests so much slower on\nWindows than Linux? Is it the 10+ ms overhead of creating each new\nprocess? https://stackoverflow.com/q/47845/284795\nhttps://stackoverflow.com/questions/10710912/what-is-the-process-creation-overhead-in-windows\n"},{"id":"511667","messageId":"Z5_8MuRxJKZm2bdH@tapette.crustytoothpaste.net","threadId":"62891","inReplyTo":"CAGJzqsmo988VwABNgozwQEKBe-nyfw9f2G2obygqs8OtuYpeiQ@mail.gmail.com","subject":"Re: \"meson test\" very slow on Windows","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-02-02T23:13:54Z","receivedAt":"2025-02-02T23:13:57Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-02-02 at 21:45:34, M Hickford wrote:\n> On Sun, 2 Feb 2025 at 07:46, Johannes Sixt <j6t@kdbg.org> wrote:\n> >\n> > Am 01.02.25 um 23:56 schrieb M Hickford:\n> > > Hi. Has anyone else found that \"meson test\" is very slow on Windows? I\n> > > built Git using \"meson compile\" with compiler MSVC and backend ninja.\n> >\n> > The tests are very slow on Windows in general. Please clarify: when you\n> > say \"very slow on Windows with meson\", do you then mean \"slower than\n> > with a Makefile build\"?\n> \n> Thanks, I didn't know about that. This is my first time I've\n> successfully built Git on Windows, so I can't compare build systems.\n> (Makefile and CMake never worked for me.)\n> \n> Out of curiosity, why are the integration tests so much slower on\n> Windows than Linux? Is it the 10+ ms overhead of creating each new\n> process? https://stackoverflow.com/q/47845/284795\n> https://stackoverflow.com/questions/10710912/what-is-the-process-creation-overhead-in-windows\n\nOur tests are primarily written in shell, which does a lot of fork and\nexec.  These are native to and highly optimized on Unix, but Windows\ndoesn't have this functionality natively for Win32 programs and the\nemulation is slow.  Part of that is because the Cygwin-based libc\nactually has to emulate it nearly perfectly for software to work.  While\na partial emulation might work in _some_ cases, it would break in\nothers, so a lot of care and expense has to be provided in making it\nwork just so.\n\nWindows _does_ have this functionality in the kernel and it is\nreasonably performant, but it's only available in the Linux subsystem\nand not in the Win32 subsystem.  The tests will probably be much faster\nif you use WSL, although that wouldn't allow you to build a Windows\nbinary.\n\nDscho and others put a lot of effort into porting shell programs into C\nto make them more performant on Windows (and elsewhere), since this has\nbeen a problem for a long time.\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"}]}