committed by
Grimes
parent
b2db0b97fc
commit
0ca943f49b
@ -2,6 +2,7 @@ pub mod cuda_runtime;
|
||||
pub mod packet;
|
||||
pub mod perf_libs;
|
||||
pub mod recycler;
|
||||
pub mod recycler_cache;
|
||||
pub mod sigverify;
|
||||
pub mod test_tx;
|
||||
|
||||
|
24
perf/src/recycler_cache.rs
Normal file
24
perf/src/recycler_cache.rs
Normal file
@ -0,0 +1,24 @@
|
||||
use crate::cuda_runtime::PinnedVec;
|
||||
use crate::recycler::Recycler;
|
||||
use crate::sigverify::TxOffset;
|
||||
|
||||
#[derive(Default, Clone)]
|
||||
pub struct RecyclerCache {
|
||||
recycler_offsets: Recycler<TxOffset>,
|
||||
recycler_buffer: Recycler<PinnedVec<u8>>,
|
||||
}
|
||||
|
||||
impl RecyclerCache {
|
||||
pub fn warmed() -> Self {
|
||||
Self {
|
||||
recycler_offsets: Recycler::warmed(50, 4096),
|
||||
recycler_buffer: Recycler::warmed(50, 4096),
|
||||
}
|
||||
}
|
||||
pub fn offsets(&self) -> &Recycler<TxOffset> {
|
||||
&self.recycler_offsets
|
||||
}
|
||||
pub fn buffer(&self) -> &Recycler<PinnedVec<u8>> {
|
||||
&self.recycler_buffer
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user