Multicore builds on MSVC

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Multicore builds on MSVC
Date: 2009-07-24 19:07:25
Message-ID: 9837222c0907241207r2542cbf4v375b0815ad786041@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

I have a simple one-line patch to enable the use of multiple CPUs or
cores when building with MSVC. It is only inside the C compiler
itself, but it makes about a 30-35% reduction in compile time on a
fairly CPU-limited dual-CPU VM. It would probably do a lot more on for
example a quadcore. It pushes the CPU to 100% when building the larger
projects like postgres.exe and psql.exe, but obviously stays a lot
lower for building all the small single-file projects, since it's only
the C compiler that uses it.

I can measure no performance decrease on single-core CPUs. Probably
because the switch makes the compiler figure out how many CPUs that
are available...

Since we only support one compiler (Visual Studio 2005) for this, I
see the risk of this as very low. The only downside is if you use this
on a development machine, it will use up all your CPU whereas
previously it used only one core. I haven't even seen normal
operations on the machine slow down thouhg...

I'm going to apply this for HEAD. I'm considering backpatching as
well, to speed up all build machines. Comments on that?

--
Magnus Hagander
Self: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-07-24 19:20:46 Re: [PATCH] user mapping extension to pg_ident.conf
Previous Message Bernd Helmle 2009-07-24 18:50:16 Re: bytea vs. pg_dump