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

rpcserver: Optimize JSON raw tx input list create. #180

Merged
merged 2 commits into from May 17, 2016

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented May 17, 2016

NOTE: Sync from upstream through Sep 30, 2015

This optimizes the createVinList function which is used to generate the JSON list of transaction inputs. It also makes it more consistent with the createVinListPrevOut function.

In particular, it entails the following changes:

  • Only do a single coinbase check and return right away instead of checking multiple times inside the loop over the inputs
  • Use a pointer for populating the details of each entry to avoid multiple unnecessary array lookups and bounds checks
  • Group all fields that populate the entry for better readability

This commit optimizes the createVinList function which is used to
generate the JSON list of transaction inputs.  It also makes it more
consistent with the createVinListPrevOut function.

In particular, it entails the following changes:
- Only do a single coinbase check and return right away instead of
  checking multiple times inside the loop over the inputs
- Use a pointer for populating the details of each entry to avoid
  multiple unnecessary array lookups and bounds checks
- Group all fields that populate the entry for better readability
@alexlyp
Copy link
Member

alexlyp commented May 17, 2016

tACK looks good. can merge after tests are fixed

@cjepson
Copy link
Contributor

cjepson commented May 17, 2016

OK

@davecgh davecgh force-pushed the merge_optimize_createvinlist branch 2 times, most recently from 8d8d496 to 8ff81ff Compare May 17, 2016 21:22
This optimizes the createVinList function which is used to generate the
JSON list of transaction inputs.  It also makes it more consistent with
the createVinListPrevOut function.

In particular, it entails the following changes:
- Only do a single coinbase check and return right away instead of
  checking multiple times inside the loop over the inputs
- Use a pointer for populating the details of each entry to avoid
  multiple unnecessary array lookups and bounds checks
- Group all fields that populate the entry for better readability
@alexlyp alexlyp merged commit 8ff81ff into decred:master May 17, 2016
@davecgh davecgh deleted the merge_optimize_createvinlist branch May 17, 2016 21:39
@jcvernaleo jcvernaleo added this to the v0.1.4 milestone May 25, 2016
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