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

Merge in btcd commit 27c0f9f8d1af6a44423b03a2e4f03d4a87a1ac40 #369

Merged
merged 4 commits into from
Sep 23, 2016

Conversation

cjepson
Copy link
Contributor

@cjepson cjepson commented Sep 23, 2016

Merges in btcd commit 27c0f9f. Generates its own large transaction rather than uses a pregenerated one, saving space and becoming platform independent.

davecgh and others added 4 commits April 25, 2016 16:17
This removes the root field and all references to it from the BlockChain
since it is no longer required.

It was previously required because the chain state was not initialized
when the instance was created.  However, that is no longer the case, so
there is no reason to keep it around any longer.
This adds a benchmark for deserializing a large transaction that is
often referred to as the megatransaction since it is the largest Bitcoin
transaction mined to date.  It consists of 5569 inputs and 1 output and
its hash is:

bb41a757f405890fb0f5856228e23b715702d714d59bf2b1feb70d8b2b4e3e08.

This is being done so there is a benchmark that tests more of a
worst-case scenario which is a better candidate for identifying and
testing improvements.

The following benchmark results shows the how much more intensive this
transaction is over the existing mock transaction:

DeserializeTxSmall  1000000    1751 ns/op      376 B/op     16 allocs/op
DeserializeTxLarge  300     5093980 ns/op  1672829 B/op  33430 allocs/op
@alexlyp
Copy link
Member

alexlyp commented Sep 23, 2016

go test PASSES
OK

@alexlyp
Copy link
Member

alexlyp commented Sep 23, 2016

go test -bench=. -benchmem=true

BenchmarkDeserializeTxSmall-8      1000000        3325 ns/op       816 B/op     21 allocs/op
BenchmarkDeserializeTxLarge-8         1000     1878517 ns/op    541914 B/op  19026 allocs/op

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

This obviously had to be changed versus the upstream test since Decred has a different transaction format, but I sort of doubt this new benchmark as written is very indicative of an actual large transaction due to the fact it's just repeating the same bytes. As a result, the cache will get loaded up versus a real mega transaction like the upstream test has.

That said, it's still better than nothing, so OK.

@cjepson cjepson merged commit e239b28 into decred:master Sep 23, 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

3 participants