From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Why does Ada compile slower than Python? Date: Wed, 18 Oct 2017 09:13:42 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <87mv4pvu2s.fsf@nightsong.com> NNTP-Posting-Host: lKHBldubgAWx1EqbQpQ5LQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:48500 Date: 2017-10-18T09:13:42+02:00 List-Id: 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