[m-rev.] for post-commit review: monomorphize some folds

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Dec 2 20:39:56 AEDT 2022



On Fri, 02 Dec 2022 19:22:38 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> I see. The culprit must be the change chunk starting at line 626
> of DIFF.mono, which replaced this
> 
> -        foldl2_maybe_stop_at_error(KeepGoing,
> -            foldl2_maybe_stop_at_error_maybe_parallel(KeepGoing,
> -                make_module_target),
> -            Globals, [Int1s, Opts], Succeeded, !Info, !IO)
> 
> with two sequential folds, one over Int1s, and one over Opts.
> These should both be parallel folds. I am bootchecking that fix now.

The attached committed diff should fix the regression. However,
you may want to try replacing the sequential fold making the .int3
files with a parallel fold. I am pretty sure it would work, though
I am not sure it would yield a speedup, because the job control
overheads may cost more time than what the parallelism may
buy you. It should also be possible to make the .int0 files in
parallel for separate submodules, though I am skeptical
about that being also true for nested submodules,
and I don't think the data structures available in that predicate
distinguish the two.

I also note that forkable_module_compilation_task_type returns
NO for making .intN for all values of N, though I have no idea
how the call to that predicate on line 388 of make.module_target.m
is supposed to interact with the test on the next line; why test
for forkability on a code path that you take only if you cannot fork?

Zoltan.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.fold6
Type: application/octet-stream
Size: 241 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20221202/7f31655d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.fold6
Type: application/octet-stream
Size: 4237 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20221202/7f31655d/attachment-0001.obj>


More information about the reviews mailing list