Skip to content

Speed up merlin#4091

Closed
rgrinberg wants to merge 5 commits intoocaml:masterfrom
rgrinberg:speed-up-merlin
Closed

Speed up merlin#4091
rgrinberg wants to merge 5 commits intoocaml:masterfrom
rgrinberg:speed-up-merlin

Conversation

@rgrinberg
Copy link
Member

We're doing the same work for every single module in a library. This PR makes it
do it only once.

@rgrinberg rgrinberg requested a review from voodoos January 9, 2021 13:54
@rgrinberg
Copy link
Member Author

@Khady does this PR make a meaningful difference?

@rgrinberg
Copy link
Member Author

rgrinberg commented Jan 9, 2021

@voodoos Independently of this pr: the preprocessing handling in the merlin code seems wrong to me. It seems like we don't handle per_module correctly.

Do not do the same work for every module in a library

Signed-off-by: Rudi Grinberg <[email protected]>
Signed-off-by: Rudi Grinberg <[email protected]>
Signed-off-by: Rudi Grinberg <[email protected]>
Signed-off-by: Rudi Grinberg <[email protected]>
++ Pp.newline
++ Pp.vbox
(Pp.concat_map modules ~f:(fun m ->
Pp.text (Module_name.to_string m)))
Copy link
Collaborator

@voodoos voodoos Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for debugging and testing only, and it feels less useful to have a module's name printed after its configuration (and it brings lot of small changes to the tests). Is there a specific reason why you chose to switch them ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought it made the tests neater. Now we aren't printing the same configuration over and over.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that merging identical configuration is better, I was just complaining about the module names being printed after and not before the configuration.

However I had to re-duplicate for Per_module pp configs #4092.

@voodoos
Copy link
Collaborator

voodoos commented Jan 11, 2021

These changes looks good to me.

@voodoos Independently of this pr: the preprocessing handling in the merlin code seems wrong to me. It seems like we don't handle per_module correctly.

That's probably true, I will have a look today.

@Khady
Copy link
Contributor

Khady commented Jan 11, 2021

@rgrinberg I haven't checked if the merlin files are the same as before, but the the noop warm build went from 7.6s with 2.7.1 to 4.6s with this PR. Part of the gain is from #4064. But I think that 4.6s is at least a whole second faster than the numbers I got for #4064.

@rgrinberg
Copy link
Member Author

But I think that 4.6s is at least a whole second faster than the numbers I got for #4064.

Yes, I didn't expect much more than that. A fresh profile with this PR would be helpful. This RP removes a bunch of unnecessary maps and sets operations that overlap with other parts of the code, so the profile should look somewhat different now.

@Khady
Copy link
Contributor

Khady commented Jan 11, 2021

I will provide one tomorrow

@rgrinberg
Copy link
Member Author

Closed in favor of #4092

@rgrinberg rgrinberg closed this Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants