From: ludo@gnu.org (Ludovic Courtès)
To: "Taylan Ulrich \"Bayırlı/Kammer\"" <taylanbayirli@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] build: Speed up .go compilation.
Date: Thu, 14 Jan 2016 15:02:35 +0100 [thread overview]
Message-ID: <87a8o8qmx0.fsf@gnu.org> (raw)
In-Reply-To: <87ziwbvkz2.fsf@T420.taylan> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Mon, 11 Jan 2016 22:56:33 +0100")
taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:
> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Mark H Weaver <mhw@netris.org> skribis:
>>
>>> I haven't yet investigated, but my strong suspicion is that this is due
>>> to the fact that Guile's module system is not thread safe. More
>>> specifically, when a new module is created, it mutates the global
>>> directory of modules in a way that is not thread safe.
>>>
>>> New modules are created by 'compile-file', both for the module being
>>> compiled and for any imported modules that haven't been previously
>>> loaded. Unfortunately, this means that this approach of compiling files
>>> in multiple threads within a single guile process is not safe. There
>>> are likely to be random crashes and corruptions.
>>
>> Right. This is one of the concerns I raised before I forgot again. ;-)
>>
>> https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00359.html
>>
>> Taylan writes:
>>
>>> The latest version of the patch loads all needed modules first, in the
>>> main thread, and then compiles the files corresponding to the modules in
>>> parallel. Does that still lead to mutation in the directory of modules
>>> in the parallelized segment of the code?
>>
>> It seems to be safe, but we’re treading in a risky zone.
>>
>> We’re pushing ‘compile-file’ and related code to its limits. It would
>> be great to address these issues in Guile itself.
>
> If we don't call compile-file in parallel but still do everything in one
> process, we will still be cutting down the time significantly.
>
> For instance, currently the load phase and compile phase take about one
> minute each on my machine with 4 cores. Making it non-parallel would
> mean the compile time takes 4x longer, i.e. 4 min., which brings us to 5
> minutes total. The original was around 20. On devices with fewer
> cores, the parallel compile is even less important.
>
> So in the worst case we can just turn that par-for-each into a for-each
> and still get benefits.
Right.
Mark, WDYT?
I would say: go for it, and let’s switch back to ‘for-each’ if/when we
have evidence of things going wrong.
I think that if things go wrong, that’ll be a hard failure (segfault or
some random run-time error) and not a silent hard-to-detect corruption.
Ludo’.
next prev parent reply other threads:[~2016-01-14 14:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 16:41 [PATCH] Makefile: Speed up .go compilation Taylan Ulrich Bayırlı/Kammer
2016-01-08 11:48 ` [PATCH] build: " Taylan Ulrich Bayırlı/Kammer
2016-01-08 17:06 ` Ludovic Courtès
2016-01-09 19:38 ` Taylan Ulrich Bayırlı/Kammer
2016-01-09 21:59 ` Ludovic Courtès
2016-01-10 10:24 ` Taylan Ulrich Bayırlı/Kammer
2016-01-10 17:01 ` Mathieu Lirzin
2016-01-10 20:46 ` Taylan Ulrich Bayırlı/Kammer
2016-01-11 21:16 ` Ludovic Courtès
2016-01-10 13:34 ` Taylan Ulrich Bayırlı/Kammer
2016-01-10 15:11 ` Taylan Ulrich Bayırlı/Kammer
2016-01-10 17:27 ` Mathieu Lirzin
2016-01-10 20:52 ` Taylan Ulrich Bayırlı/Kammer
2016-01-10 21:18 ` Mathieu Lirzin
2016-01-11 21:05 ` Ludovic Courtès
2016-01-11 21:47 ` Taylan Ulrich Bayırlı/Kammer
2016-01-10 16:47 ` Mark H Weaver
2016-01-10 20:33 ` Taylan Ulrich Bayırlı/Kammer
2016-01-11 21:14 ` Ludovic Courtès
2016-01-11 21:56 ` Taylan Ulrich Bayırlı/Kammer
2016-01-14 14:02 ` Ludovic Courtès [this message]
2016-01-17 20:16 ` Ludovic Courtès
2016-01-18 8:05 ` Taylan Ulrich Bayırlı/Kammer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a8o8qmx0.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=taylanbayirli@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.