Skip to content

Commit 7db65c3

Browse files
author
MarcoFalke
committed
Merge #11011: [Trivial] Add a comment on the use of prevector in script.
08f71c2 [Trivial] Add a comment on the use of prevector in script. (Gregory Maxwell) Pull request description: Tree-SHA512: 020981516e67e576685eb9a8532178fb97d1780af409fc86d869cd05c293c0c823c26e838cf544d18610f5a3f479ce3e47d2ccb95fb1c4e55fe9e7ceb354f20b
2 parents 6366941 + 08f71c2 commit 7db65c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/script/script.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,12 @@ class CScriptNum
377377
int64_t m_value;
378378
};
379379

380+
/**
381+
* We use a prevector for the script to reduce the considerable memory overhead
382+
* of vectors in cases where they normally contain a small number of small elements.
383+
* Tests in October 2015 showed use of this reduced dbcache memory usage by 23%
384+
* and made an initial sync 13% faster.
385+
*/
380386
typedef prevector<28, unsigned char> CScriptBase;
381387

382388
/** Serialized script, used inside transaction inputs and outputs */

0 commit comments

Comments
 (0)