Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo field updates for faster compile #3044

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Sep 19, 2022

Field updates like

 foo {field1 = exp }

Seem to take forever to compile if 'exp' has a complicated type.
Empirical analysis shows that replacing them with simple update functions can dramatically speed things up
for example.

update1 f = \ x -> (x{field1 = f (field1 x)})

we recombined Test.Cardano.Ledger.Generic.GenState.Types, Test.Cardano.Ledger.Generic.GenState.GenScript, and Test.Cardano.Ledger.Generic.GenState.Generate into Test.Cardano.Ledger.Generic.GenState

we also redid Test.Cardano.Ledger.Generic.TxGen

cardano-ledger-test now cuts approximately 20 minutes from compile time.

@TimSheard TimSheard requested a review from lehins September 19, 2022 21:00
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

I am glad that you found this weird compiler performance regression. Waiting for 5 minutes for a module to be compiled was a little too much.

@JaredCorduan JaredCorduan merged commit d030821 into master Sep 27, 2022
@iohk-bors iohk-bors bot deleted the ts-faster-compile branch September 27, 2022 11:57
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