Branch: refs/heads/master
  Home:   https://github.com/btcsuite/btcd
  Commit: b14032487f67ac140606e7b5f4cd4781243c62c7
      
https://github.com/btcsuite/btcd/commit/b14032487f67ac140606e7b5f4cd4781243c62c7
  Author: Dave Collins <d...@davec.name>
  Date:   2016-04-25 (Mon, 25 Apr 2016)

  Changed paths:
    M wire/bench_test.go

  Log Message:
  -----------
  wire: Add several decode benchmarks. (#682)

This adds decode benchmarks for several of the messages that profiling
has identified to cause a lot of allocations in addition to those that
already exist.  By adding these benchmarks, it makes it easier to get
allocation and speed statistics which can in turn be used to compare
future improvements.

The following bencharmarks have been added:

DecodeGetHeaders, DecodeHeaders, DecodeGetBlocks, DecodeAddr, DecodeInv,
DecodeNotFound, and DecodeMerkleBlock

For reference, here is the benchmark data as of this commit.

DecodeGetHeaders     93261 ns/op     24120 B/op     1004 allocs/op
DecodeHeaders      2071263 ns/op    368399 B/op    18002 allocs/op
DecodeGetBlocks      92486 ns/op     24120 B/op     1004 allocs/op
DecodeAddr          850608 ns/op    136202 B/op     9002 allocs/op
DecodeInv         17107172 ns/op   3601447 B/op   150004 allocs/op
DecodeNotFound    17522225 ns/op   3601444 B/op   150004 allocs/op
DecodeMerkleBlock    21062 ns/op      5192 B/op      222 allocs/op


Reply via email to