#include <OnixS/B3/MarketData/UMDF/OrderBook.h>
Classes | |
struct | GrowthPolicy |
Public Attributes | |
size_t | chunksAmount = 1000 |
size_t | chunkLength = 512 * 1024 |
bool | preferHugePage = false |
GrowthPolicy | growthPolicy = {GrowthPolicy::Addition, 1.0f} |
To improve performance, the OrderBook keeps some of its internals in the preallocated memory areas (chunks).
The chunks are initially owned by the OrderBookPool object. The OrderBookPool
object is shared between the OrderBook
s (and can be shared between several instances of the handlers).
When a chunk is taken from the pool, it is not shared between the other order books, so the number of the chunks must be at least equal to the number of order books. A single order book can use from 1 to 255 chunks if necessary.
The number of books equals the number of securities on a channel or the size of the security filter (if used).
Placing the order book's internals into a single chunk improves data locality and can thus improve performance, so the chunk must be sufficient to fit the book content. On the other hand, making a chunk too big can lead to excessive memory consumption.
Definition at line 50 of file OrderBook.h.
size_t chunkLength = 512 * 1024 |
Length of a chunk.
The maximum chunk length should not be much more than the size of memory necessary to store all orders for security.
Definition at line 59 of file OrderBook.h.
size_t chunksAmount = 1000 |
Amount of memory chunks.
Definition at line 54 of file OrderBook.h.
GrowthPolicy growthPolicy = {GrowthPolicy::Addition, 1.0f} |
Definition at line 84 of file OrderBook.h.
bool preferHugePage = false |
Use Huge pages for chunk allocation.
Definition at line 64 of file OrderBook.h.