Skip to content
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

Add checksum to speed up easyjson #91

Merged
merged 10 commits into from
May 5, 2017
Merged

Add checksum to speed up easyjson #91

merged 10 commits into from
May 5, 2017

Conversation

Raynos
Copy link
Contributor

@Raynos Raynos commented May 5, 2017

EasyJSON can make make generate take upto 60 seconds.

With the new checksum caching / short circuiting the
make generate step now takes 10 seconds.

r: @uber/zanzibar-team

@Matt-Esch
Copy link
Contributor

So now that you're not cleaning the gen-code dir, how are you going to remove excess files?

@Raynos
Copy link
Contributor Author

Raynos commented May 5, 2017

I dont know how we are going to remove excess files. travis will fail if you dont remove them by hand.

We cant clean the directory if we want to re-use checksum and have faster builds :(

@Matt-Esch
Copy link
Contributor

Well there is a process that checks the files, can you keep a list of the files that were checked or generated from scratch and remove anything not in that list?

@Raynos
Copy link
Contributor Author

Raynos commented May 5, 2017

@Matt-Esch thats only for the gen-code/*.go -> gen-code/*_easyjson.go pipeline, not the idl/*.thrift -> gen-code/*.go pipeline, would only remove half the dead files.

@coveralls
Copy link

coveralls commented May 5, 2017

Coverage Status

Coverage decreased (-0.04%) to 69.134% when pulling 7f5b7e5 on easyjson-checksum into 8c62d35 on master.

Copy link
Contributor

@ChuntaoLu ChuntaoLu left a comment

Choose a reason for hiding this comment

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

LGTM

oldEasyJSONBytes, err := ioutil.ReadFile(easyJSONFile)
if err == nil {
sliceStart := len(prefixBytes) + len(checksumPrefix)
sliceEnd := len(prefixBytes) + len(checksumPrefix) + 24
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: const checksumLen = 24 could make 24 less magical.

@Raynos
Copy link
Contributor Author

Raynos commented May 5, 2017

I'll add the ability to remove generated files in a separate PR.

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.

None yet

4 participants