Re: windows build slow due to windows.h includes

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Re: windows build slow due to windows.h includes
Дата
Msg-id CAEudQArq7NQ_TRT-M30=zfC8_Ep3Lx+UpipYONqxfSB0gmTgbA@mail.gmail.com
обсуждение исходный текст
Ответ на windows build slow due to windows.h includes  (Andres Freund <andres@anarazel.de>)
Ответы Re: windows build slow due to windows.h includes  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Em ter., 21 de set. de 2021 às 16:30, Andres Freund <andres@anarazel.de> escreveu:
Hi,

For the AIO stuff I needed to build postgres for windows. And I was a bit
horrified by the long compile times. At first I was ready to blame the MS
compiler for being slow, until I noticed that using mingw gcc from linux to
cross compile to windows is also a *lot* slower than building for linux.

I found some blog-post-documented-only compiler flags [1], most importantly
/d1reportTime. Which shows that the include processing of postgres.h takes
0.6s [2]

Basically all the time in a debug windows build is spent parsing windows.h and
related headers. Argh.

The amount of stuff we include in win32_port.h and declare is pretty absurd
imo. There's really no need to expose the whole backend to all of it. Most of
it should just be needed in a few port/ files and a few select users.

But that's too much work for my taste. As it turns out there's a partial
solution to windows.h being just so damn big, the delightfully named
WIN32_LEAN_AND_MEAN.
+1
But I did a quick dirty test here, and removed windows.h in win32_port.h,
and compiled normally with msvc 2019 (64 bit), would it work with mingw cross compile?

regards,
Ranier Vilela

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: Re: Eval expression R/O once time (src/backend/executor/execExpr.c)
Следующее
От: Rachel Heaton
Дата:
Сообщение: Re: [PATCH] Implement INSERT SET syntax