Skip to content

Commit bdd98e8

Browse files
committed
[Trivial] Add a comment on the use of prevector in script.
backports bitcoin/bitcoin@08f71c2
1 parent bbaa6e3 commit bdd98e8

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
@@ -363,6 +363,12 @@ class CScriptNum
363363
int64_t m_value;
364364
};
365365

366+
/**
367+
* We use a prevector for the script to reduce the considerable memory overhead
368+
* of vectors in cases where they normally contain a small number of small elements.
369+
* Tests in October 2015 (bitcoin) showed use of this reduced dbcache memory usage by 23%
370+
* and made an initial sync 13% faster.
371+
*/
366372
typedef prevector<28, unsigned char> CScriptBase;
367373

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

0 commit comments

Comments
 (0)