Branch: refs/heads/master
  Home:   https://github.com/conformal/btcchain
  Commit: b6e4ae44419ab5efa232eb32bfcb2d45023918be
      
https://github.com/conformal/btcchain/commit/b6e4ae44419ab5efa232eb32bfcb2d45023918be
  Author: Dave Collins <[email protected]>
  Date:   2013-10-26 (Sat, 26 Oct 2013)

  Changed paths:
    M validate.go

  Log Message:
  -----------
  Optimize duplicate transaction input check.

Profiling showed the duplicate transaction input check was taking around
6% of the total CheckTransactionSanity processing time.  This was largely
due to using fmt.Sprintf to generate the map key.

This commit modifies the check instead to use the actual output as a map
key.

The following benchmark results show the difference:

Before: BenchmarkOldDuplicatInputCheck    100000     21787 ns/op
After:  BenchmarkNewDuplicatInputCheck   2000000       937 ns/op

Closes #2



Reply via email to