Skip to content

Commit 08f71c2

Browse files
committed
[Trivial] Add a comment on the use of prevector in script.
1 parent 2507fd5 commit 08f71c2

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)