comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Why does Ada compile slower than Python?
Date: Wed, 18 Oct 2017 09:13:42 +0200
Date: 2017-10-18T09:13:42+02:00	[thread overview]
Message-ID: <os6uv5$1a12$1@gioia.aioe.org> (raw)
In-Reply-To: 87mv4pvu2s.fsf@nightsong.com

On 18/10/2017 08:38, Paul Rubin wrote:
> olivermkellogg@gmail.com writes:
>> if you provide 100 files on a single gcc command line then gcc loads
>> and compiles each file separately as though you were providing 100
>> commands with one file per command.
> 
> Usually you'd use make -j which will do compilation in parallel if
> you have a multicore machine.  I use that with C and C++ programs all
> the time and it's a big help.  There are even some distributed make
> programs that will spin your compilation out across a whole cluster,
> but I do most of my stuff on a regular 4-core i7 box.  I don't know
> the situation with compiling Ada in parallel.
Of course both gprbuild and gnatmake support -jN. But one must be 
careful on platforms with many cores and little memory. E.g. on a 
Raspberry Pi you cannot always use all 4 cores. Should you hit the swap 
it will hard freeze. Excessive memory consumption of GNAT surely costs 
performance, just because all these gigabytes of memory must be read and 
written at least once. Another contributor is catastrophic performance 
of GNU linker. It takes about an hour just to link a large stand-alone 
library.

> As for the compilation speed of Gnat vs Python, you have to remember
> that the Python "compiler" (it makes bytecode for a VM) is very simple,
> very little optimization, no typechecking, etc.  But Gnat should compile
> faster with optimization turned off than with it on, for your debugging
> builds.

In my experience optimization does not influence compilation time 
considerably. It takes almost same time to compile with -O0 and -O2.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2017-10-18  7:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 23:01 Why does Ada compile slower than Python? Victor Porton
2017-10-03  0:05 ` Leff Ivanov
2017-10-03  1:11 ` gautier_niouzes
2017-10-03 11:31   ` Brian Drummond
2017-10-03 20:14   ` Randy Brukardt
2017-10-03 21:23     ` gautier_niouzes
2017-10-03 13:07 ` bartc
2017-10-03 13:41   ` G.B.
2017-10-03 21:08 ` Victor Porton
2017-10-04 15:00   ` Simon Wright
2017-10-18  5:56   ` olivermkellogg
2017-10-18  6:38     ` Paul Rubin
2017-10-18  7:13       ` Dmitry A. Kazakov [this message]
2017-10-18  7:34         ` Björn Lundin
2017-10-18  8:02           ` Dmitry A. Kazakov
2017-10-20  6:25             ` gautier_niouzes
2017-10-04  0:21 ` Mace Ayres
2017-10-04  1:51   ` Andrew Shvets
2017-10-04  1:54 ` Andrew Shvets
2017-10-04 15:47 ` gautier_niouzes
2017-10-04 16:03   ` Victor Porton
2017-10-07 11:47     ` Blady
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox