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

Hash an entire json input in one call. #7759

Merged

Conversation

Projects
None yet
2 participants
@stuhood
Copy link
Member

commented May 18, 2019

Problem

hash_all takes a list of strings, but was being passed a string. And thanks to python's venerable implicit conversion from string to list of (single character) strings, that ... "worked".

Solution

Pass a list of strings.

Result

Surprisingly little performance difference (less than 2% in this usecase), but a better example to follow in future.

@stuhood stuhood merged commit d7e7226 into pantsbuild:master May 18, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stuhood stuhood deleted the twitter:stuhood/one-hash-call-per-stable_json_hash branch May 18, 2019

@stuhood stuhood added this to the 1.16.x milestone May 19, 2019

stuhood added a commit that referenced this pull request May 19, 2019

Hash an entire json input in one call. (#7759)
### Problem

`hash_all` takes a list of strings, but was being passed a string. And thanks to python's venerable implicit conversion from string to list of (single character) strings, that ... "worked".

### Solution

Pass a list of strings.

### Result

Surprisingly little performance difference (less than 2% in this usecase), but a better example to follow in future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.