pub struct Options { /* private fields */ }
Expand description
Options to tune the performance of the parser, generally you can stick to the defaults unless you run into memory issues.
Implementations§
Source§impl Options
impl Options
Sourcepub fn order_output(self) -> Self
pub fn order_output(self) -> Self
Ensures that the output of the BlockParser::parse
function will be in same order as the
[BlockHeader
] passed in.
BlockParser::batch
will receive blocks in-order, however this requires running that
function on a single thread, rather than multiple threads.
Sourcepub fn num_threads(self, n: usize) -> Self
pub fn num_threads(self, n: usize) -> Self
Set the number of threads to handle the processing steps.
Typically limited by disk I/O and the number of threads your system can handle, increasing it generally improves speed at the cost of memory usage.
Sourcepub fn batch_size(self, n: usize) -> Self
pub fn batch_size(self, n: usize) -> Self
Number of items passed into BlockParser::batch
.
If you need to access shared state through an Arc<Mutex<_>>
a bigger batch size can
improve performance, at the cost of more memory depending on the size of BlockParser::extract
Sourcepub fn channel_buffer_size(self, n: usize) -> Self
pub fn channel_buffer_size(self, n: usize) -> Self
Set the number of size of the buffers used between channels.
Doesn’t have a significant impact on speed/memory so long as it’s set high enough.
Trait Implementations§
Source§impl Default for Options
impl Default for Options
Defaults that should be close to optimal for most parsers
order_output
determines whether the results will be returned in-order
num_threads: 128
should be enough for most systems regardless of disk speed
batch_size: 10
improves batch performance without using too much memory
channel_buffer_size: 100
increasing beyond this usually just increases memory usage
log_at: 10_000
will produce logs every few seconds without spamming output