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

wire: Use large tx for deserialize benchmark. #678

Merged
merged 1 commit into from
Apr 25, 2016

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Apr 25, 2016

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

@@ -306,7 +308,7 @@ func BenchmarkWriteTxIn(b *testing.B) {
}

// BenchmarkDeserializeTx performs a benchmark on how long it takes to
// deserialize a transaction.
// deserialize a small transaction.
func BenchmarkDeserializeTx(b *testing.B) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add Small here as well to match?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

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
@jrick
Copy link
Member

jrick commented Apr 25, 2016

ok

@davecgh davecgh merged commit 27c0f9f into btcsuite:master Apr 25, 2016
@davecgh davecgh deleted the wire_large_bench_tx branch April 25, 2016 21:51
cjepson pushed a commit to cjepson/btcd that referenced this pull request Sep 21, 2016
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
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

2 participants