generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optimistically compile go modules while extracting schema (#3385)
### Description - The two longest parts to build a go module is schema extraction and compilation. - Some code changes (like a verb changing name, or sumtype changes) require compilation to happen after schema extraction so that we can generate code based on the latest schema. - During development though, most builds will be done with compilation not dependant on schema extraction. - This PR optimises for this case by optimistically compiling while schema extraction occurs if previous code generation is present. After the schema is extracted we then generate code and check if anything has changed that requires re-compilation. ### Performance Ran `ftl dev examples/go/time`, waiting for the initial builds to complete, and then modified the module code 20 times to get an average. | Case | Small Change | Verb Change | -- | -- | -- Last week's code | 2.24s | 3.01s [With smart `go mod tidy` detection](fa14481) | 1.76s (-27%) | 2.99s (~0%) With optimistic compile (This PR) | 1.30s (-72%) | 3.14s (+5%)
- Loading branch information
Showing
7 changed files
with
155 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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