Open
Conversation
8063176 to
88129bd
Compare
cd16dc7 to
c524e89
Compare
2c59aea to
bde3322
Compare
8b97729 to
d20a236
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows users to define module
traits that can be instantiated inbuild.mill.yamlandpackage.mill.yamlfiles without needing to be codegened and compiled. This can speed up Mill initialization substantially in scenarios where the build is mostly declarative.mill.yamlmodules.The user opts in by defining a
class PreCompiled() extends mill.api.PreCompiledModulein theirtrait's companionobject, and any.mill.yamlfile thatextendsa single label that matches that class will use the pre-compiledclassinstantiated reflectively rather than the originaltraitinstantiated via codegen.Notes:
We are only able to skip codegen in yaml modules who do not have programmable descendents. For programmable modules with yaml descendents, we would need to codegen the yaml module reference in the nearest enclosing programmable ancestor, so
build.foo.bar.quxprogrammable references works.So if everything is declarative then no codegen needs to happen, but if the root is programmable and the children are declarative the root needs to generate a object tree, and if the root is declarative and some descendent is programmable we also need to codegen something for the root to handle
build.*references