-
Notifications
You must be signed in to change notification settings - Fork 38
Reduce runtime of autogen #1266
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
base: main
Are you sure you want to change the base?
Conversation
a152f62 to
473edd8
Compare
2cf4003 to
4f6565c
Compare
scripts/autogen
Outdated
| gen_preprocessor_comments() | ||
| high_level_status("Generated preprocessor comments") | ||
|
|
||
| finalize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there no args.dry_run here?
I don't understand how the linting works. I thought it will fail in the finalize step, but that does not seem to be the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, thank you for catching this. This is crucial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Instead of writing updated content to FS immediately, redirect all file read/write operations through an internal in-memory cache, and flush to memory only at the end. This also has the side-benefit that intermediate steps in dry-run don't need to produce the final file, so we can format only once in the end. Formatting performance is improved by processing multiple files at once using clang-format. A file scheduled to be deleted is signified by a `None` content. Signed-off-by: Hanno Becker <[email protected]>
Signed-off-by: Hanno Becker <[email protected]>
- Abort early if a file does not contain any citations. - Manually wrap long lines rather than invoking clang-format. Signed-off-by: Hanno Becker <[email protected]>
Manually wrap long comments, and reuse condition parser object. Signed-off-by: Hanno Becker <[email protected]>
Signed-off-by: Hanno Becker <[email protected]>
Signed-off-by: Hanno Becker <[email protected]>
Signed-off-by: Hanno Becker <[email protected]>
Signed-off-by: Hanno Becker <[email protected]>
4f6565c to
62df8ad
Compare
Various smaller improvements to speed up
scripts/autogen.On my local machine: 40s -> 16s