-
Notifications
You must be signed in to change notification settings - Fork 699
Generate script: Don't write .cc or .h files if unchanged #1091
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
Conversation
4a47146 to
4c1a277
Compare
|
You realize that using |
|
@maxkorp i think this fixes the issue where you make a change to the templates / add definition / add supplement, and you need to run generate, again. This stops the generate script from overwriting unchanged files. That way if you run node-gyp build, it will only build the files that have changed, rather than compile everything @smith-kyle am I right here? |
|
Ah interesting, my bad. Lemme play with it a bit, that could be useful then 👍. |
|
So, the overall recompile time without this is still fairly small, the bulk of the overall compile time is openssl and that isn't affected in this case (and the second largest is libgit2, which is also unaffected). That said, if this is a big deal to you guys I'm cool with it. Any reason we don't use |
|
Still relatively small but compilation is going from ~90 seconds to < 5 seconds if you've only changed a couple generated files. This is the first I'm hearing about |
|
Awesome. Thanks a pretty big change, so I can dig it 👍 |
40c8479 to
71b3ff2
Compare
|
@maxkorp I've (finally) moved this to use |
|
I don't have push access to your repo to rebase this, so you gotta rebase this, but it's G2G man. |
The generation script now checks whether the file has changed before writing it to `/src` or `/include`. This is to improve compilation time when testing changes to generated code. It works by creating a `/temp` directory, writing the generated code to `/temp/src` and `/temp/include`, then syncing those folders with `/src` and `/include` by deleting files that no longer exist and copying files that have changed or been added since the last code generation. Finally the `/temp` directory is deleted If `/src` and `/include` don't exist (i.e. it's the first time the generation script has been run), `/temp/src` will be copied to `/src` and `/temp/include` will be copied to `/include`.
7870a47 to
02060bf
Compare
|
Rebased 👍 |
|
Tested. Looks good, works good. Thanks @smith-kyle! |
The generation script now checks whether the file has changed before writing it to
/srcor/include. This is to improve compilation time when testing changes to generated code.It works by creating a
/tempdirectory, writing the generated code to/temp/srcand/temp/include, then syncing those folders with/srcand/includeby deleting files that no longer exist and copying files that have changed or been added since the last code generation. Finally the/tempdirectory is deletedIf
/srcand/includedon't exist (i.e. it's the first time the generation script has been run),/temp/srcwill be copied to/srcand/temp/includewill be copied to/include.