D compilation is too slow and I am forking the compiler

Walter Bright newshound2 at digitalmars.com
Wed Nov 21 20:49:57 UTC 2018


On 11/21/2018 3:19 AM, Iain Buclaw wrote:
> On Wednesday, 21 November 2018 at 10:56:02 UTC, Walter Bright wrote:
>>
>> Wouldn't it be awesome to have the lexing/parsing of the imports all done in 
>> parallel? The main difficulty in getting that to work is dealing with the 
>> shared string table.
> 
> What about creating a new Fiber for each module needing lexing/parsing/semantic 
> to be ran?  Compilation of one module would then get as far as it can until it 
> needs to defer, then calls yield() to continue compilation of the next module.  
> This in hope that when the round trip returns, the AST will be sufficiently 
> complete enough for compilation to continue.

Since the lexing/parsing does not do any blocking calls, fibers won't help. It 
has to be another hardware thread.

Trying to parallelize semantic over multiple modules will be very hard to do.


More information about the Digitalmars-d-announce mailing list