Skip to content

Conversation

@johnhaley81
Copy link

With nested queries the code was switching on the option so that it
could display a custom message. This was causing a massive increase in
compilation time as the queries got deeper and wider. In my project we
were seeing build times of about 6 minutes, after this change the build
went down to about 10-11 seconds.

Instead of displaying a custom message, the PPX will now just call out
to Js.Option.getExn.

This might also fix #61

With nested queries the code was switching on the option so that it
could display a custom message. This was causing a massive increase in
compilation time as the queries got deeper and wider. In my project we
were seeing build times of about 6 minutes, after this change the build
went down to about 10-11 seconds.

Instead of displaying a custom message, the PPX will now just call out
to `Js.Option.getExn`.

This might also fix mhallin#61
Copy link
Contributor

@baransu baransu left a comment

Choose a reason for hiding this comment

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

Looks good for me

@wokalski
Copy link
Contributor

I think we should first understand the cause of the issue (ie how do the differences in output impact compilation performance). Or maybe it’s not differences in the output but the time it takes to compile the make error function

@johnhaley81
Copy link
Author

@wokalski My original idea was that the time it takes the PPX to run was the culprit as well. To test this you can go to this repo here and see that the final generated output of the code is the thing that takes a very long time to build using bsc.

You can see how the above PR changes the final compiled code by comparing the master branch of that graphql-ppx-perf-repo to this

@johnhaley81
Copy link
Author

@wokalski @baransu I'm not quite sure what's going on with the CI stuff. It seems like CI is just currently broken.

Outside of that, are there any other questions I can answer?

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.

Nested Unions makes compiler hang

3 participants