Quantcast

Performance Clang

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Performance Clang

Heiko
Hello Misc,

I'm using current on amd64 (Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,
3411.91 MHz)

I noticed that with clang it needs 109 minutes for "make build" and
before with gcc 32 minutes.

Is this a normal behavior?

Best,
Heiko

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Theo de Raadt-2
> I'm using current on amd64 (Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,
> 3411.91 MHz)
>
> I noticed that with clang it needs 109 minutes for "make build" and
> before with gcc 32 minutes.
>
> Is this a normal behavior?

For sure.  Why the surprise?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Michael McConville-3
In reply to this post by Heiko
Heiko wrote:
> I noticed that with clang it needs 109 minutes for "make build" and
> before with gcc 32 minutes.
>
> Is this a normal behavior?

An email from Miod that gets cited often:

https://marc.info/?l=openbsd-misc&m=137530560232232&w=2

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Heiko
In reply to this post by Theo de Raadt-2
I was not aware that the difference is 340%.

So I guess the main advantage is the license?
Or is clang technically (binaries, debug) better?

Am 20.04.17 um 03:42 schrieb Theo de Raadt:

>> I'm using current on amd64 (Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,
>> 3411.91 MHz)
>>
>> I noticed that with clang it needs 109 minutes for "make build" and
>> before with gcc 32 minutes.
>>
>> Is this a normal behavior?
>
> For sure.  Why the surprise?
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Theo de Raadt-2
> I was not aware that the difference is 340%.
>
> So I guess the main advantage is the license?

No.

> Or is clang technically (binaries, debug) better?

No.

Basically, this cannot be oversimplified by 1 line questions followed
by 1 line answers.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Heiko
In reply to this post by Michael McConville-3
Thank you.

Am 20.04.17 um 03:55 schrieb Michael McConville:
> An email from Miod that gets cited often:
>
> https://marc.info/?l=openbsd-misc&m=137530560232232&w=2

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Karel Gardas
In reply to this post by Heiko
On Thu, Apr 20, 2017 at 1:43 AM, Heiko <[hidden email]> wrote:
> Hello Misc,
>
> I'm using current on amd64 (Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,
> 3411.91 MHz)
>
> I noticed that with clang it needs 109 minutes for "make build" and
> before with gcc 32 minutes.
>
> Is this a normal behavior?

This is entirely unfair comparison. I've just make build yesterday
tree to verify your claims and honestly what I've seen is:

1) system/core is still built with cc which means gcc 4.2.1
2) added compiler_rt is built with clang
3) added libc++ is built with clang++
4) added LLVM needed by clang is build with clang++
5) added clang is build with clang++

so what you compare is:
- OpenBSD system/core build with GCC 4.2.1 (old system)
with
- OpenBSD system/core build with GCC 4.2.1 and Clang runtime libraries
and LLVM code and Clang itself built with Clang (new system)

IMHO very unfair comparison and you should really wait till OpenBSD
system/core is build with Clang and GCC 4.2.1 is removed from the
build process. Well, do not hold your breath for that to be comparable
in speed. LLVM/Clang is C++ beast and so it takes some time to compile
but at least the comparison would be more fair...

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Christian Weisgerber
In reply to this post by Heiko
On 2017-04-19, Heiko <[hidden email]> wrote:

> I'm using current on amd64 (Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,
> 3411.91 MHz)
>
> I noticed that with clang it needs 109 minutes for "make build" and
> before with gcc 32 minutes.

Not sure what you mean by "performance" in the subject.  We're not
building anything with clang yet, apart from clang itself.  We have
simply added clang.  The rest of the build is identical.

And yes, clang is a big C++ program and C++ code compiles s l o w l y.

> Is this a normal behavior?

The exact numbers are a bit odd, but generally speaking, yes, adding
clang has substantially increased the build time.  I see about a
doubling on Xeon E3-12xx-based machines for make -j4 build.

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Christian Weisgerber
In reply to this post by Heiko
On 2017-04-20, Heiko <[hidden email]> wrote:

> So I guess the main advantage is the license?
> Or is clang technically (binaries, debug) better?

OpenBSD does not live in a bubble.  If it did, we could still be
using gcc 2.95.  But it turns out people, including OpenBSD developers,
want to run third-party software.  And the ecosystem requires a
modern compiler.

You know what an amd64 package bulk build looks like?  First, we
use our system compiler to build gcc 4.9.  Then we use gcc 4.9 to
build clang.  And then we use clang to build interesting stuff,
like web browsers.  Stages like a moonshot rocket.

If we want to continue to be able to run third-party software, we
need a newer compiler.

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Heiko
In reply to this post by Karel Gardas
Please dont get me wrong. I dont want to start any compiler wars.

I only was worried about the compile time.

Am 20.04.17 um 20:50 schrieb Karel Gardas:
> IMHO very unfair comparison and you should really wait till OpenBSD
> system/core is build with Clang and GCC 4.2.1 is removed from the
> build process. Well, do not hold your breath for that to be comparable
> in speed. LLVM/Clang is C++ beast and so it takes some time to compile
> but at least the comparison would be more fair...

Sure, we shall see.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Heiko
In reply to this post by Christian Weisgerber
Thank you for the info. So you expect a lower time in future.

Am 20.04.17 um 21:31 schrieb Christian Weisgerber:
> The exact numbers are a bit odd, but generally speaking, yes, adding
> clang has substantially increased the build time.  I see about a
> doubling on Xeon E3-12xx-based machines for make -j4 build.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Performance Clang

Andreas Kusalananda Kähäri
In reply to this post by Christian Weisgerber
On Thu, Apr 20, 2017 at 07:31:47PM +0000, Christian Weisgerber wrote:

> On 2017-04-19, Heiko <[hidden email]> wrote:
>
> > I'm using current on amd64 (Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,
> > 3411.91 MHz)
> >
> > I noticed that with clang it needs 109 minutes for "make build" and
> > before with gcc 32 minutes.
>
> Not sure what you mean by "performance" in the subject.  We're not
> building anything with clang yet, apart from clang itself.  We have
> simply added clang.  The rest of the build is identical.
>
> And yes, clang is a big C++ program and C++ code compiles s l o w l y.
>
> > Is this a normal behavior?
>
> The exact numbers are a bit odd, but generally speaking, yes, adding
> clang has substantially increased the build time.  I see about a
> doubling on Xeon E3-12xx-based machines for make -j4 build.


I'm happy as long as building the complete base system takes less than a
day.  I'm more concerned with the compiler generating good code, to be
honest.

Cheers,
Kusalananda

Loading...