When invoking new MemoryDatabase(byte[] databaseBinary...), read and construct database from binary. If binary size is large then construct performance will slow down. MemoryDatabase has ctor(..., int maxDegreeOfParallelism = 1) option in constructor to construct in parallel.
var database = new MemoryDatabase(bin, maxDegreeOfParallelism: Environment.ProcessorCount);
The use of Parallel can greatly improve the construct performance. Recommend to use Environment.ProcessorCount.
If you want to reduce code size of generated code, Validator and MetaDatabase info can omit in runtime. Generated code has two symbols DISABLE_MASTERMEMORY_VALIDATOR and DISABLE_MASTERMEMORY_METADATABASE. By defining them, can be erased from the build code.
When invoking
new MemoryDatabase(byte[] databaseBinary...)
, read and construct database from binary. If binary size is large then construct performance will slow down.MemoryDatabase
hasctor(..., int maxDegreeOfParallelism = 1)
option in constructor to construct in parallel.The use of Parallel can greatly improve the construct performance. Recommend to use
Environment.ProcessorCount
.If you want to reduce code size of generated code, Validator and MetaDatabase info can omit in runtime. Generated code has two symbols
DISABLE_MASTERMEMORY_VALIDATOR
andDISABLE_MASTERMEMORY_METADATABASE
. By defining them, can be erased from the build code.