Branch: refs/heads/master
Home: https://github.com/btcsuite/btcd
Commit: 869363a210d278330bfcba4a5aec82281f12b086
https://github.com/btcsuite/btcd/commit/869363a210d278330bfcba4a5aec82281f12b086
Author: Josh Rickmar <[email protected]>
Date: 2015-01-19 (Mon, 19 Jan 2015)
Changed paths:
M blockmanager.go
M peer.go
Log Message:
-----------
Switch peer.requestQueue from linked list to slice.
Only two operations are performed with this data structure: adding to
the back and removing from the front. Because middle inserts and
deletions are never needed, a linked list results in overall worse
performance due to an extra allocation for each element's node, worse
cache locality, and the runtime cost of boxing/unboxing each item
during accesses.
On top of the performance gains, a slice is more type safe as it is a
true generic data structure making it is impossible to insert or
access an element with the wrong type.