File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ edition = "2021"
77debug = false
88
99[features ]
10- default = [" jemalloc " ]
10+ default = []
1111heed = [" dep:heed" ]
1212jemalloc = [" dep:jemallocator" ]
1313mimalloc = [" dep:mimalloc" ]
@@ -16,6 +16,7 @@ sqlite = ["dep:rusqlite"]
1616tcmalloc = [" dep:tcmalloc" ]
1717antithesis = [" dep:precept" ]
1818metrics = [" fjall_3/metrics" ]
19+ snmalloc = [" dep:snmalloc" ]
1920
2021[target .'cfg(not(target_env = "msvc"))' .dependencies ]
2122jemallocator = { version = " 0.5.4" , optional = true }
@@ -54,3 +55,4 @@ r2d2 = "0.8.10"
5455r2d2_sqlite = " 0.31.0"
5556format-bytes = " 0.3.0"
5657pretty-bytes = " 0.2.2"
58+ snmalloc = { package = " snmalloc-rs" , version = " 0.1.0" , optional = true }
Original file line number Diff line number Diff line change @@ -910,6 +910,7 @@ impl DatabaseWrapper {
910910 #[ cfg( feature = "metrics" ) ]
911911 GenericDatabase :: Fjall3 { tree, .. } => tree. inner ( ) . metrics ( ) . block_cache_hit_rate ( ) ,
912912
913+ #[ cfg( feature = "rocksdb" ) ]
913914 #[ cfg( feature = "metrics" ) ]
914915 GenericDatabase :: RocksDb { tickers, opts, .. } => {
915916 let cache_hits = opts. get_ticker_count ( tickers. block_cached ) as f64 ;
@@ -925,6 +926,7 @@ impl DatabaseWrapper {
925926 /// % of filter queries that successfully filtered out superfluous I/O.
926927 pub fn filter_true_negative_ratio ( & self ) -> f64 {
927928 match & self . inner {
929+ #[ cfg( feature = "metrics" ) ]
928930 GenericDatabase :: Fjall3 { tree, .. } => tree. inner ( ) . metrics ( ) . filter_efficiency ( ) ,
929931
930932 _ => 0.0 ,
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
3030#[ global_allocator]
3131static GLOBAL : tcmalloc:: TCMalloc = tcmalloc:: TCMalloc ;
3232
33+ #[ cfg( feature = "snmalloc" ) ]
34+ #[ global_allocator]
35+ static ALLOC : snmalloc:: SnMalloc = snmalloc:: SnMalloc ;
36+
3337/// Gets the unix timestamp as a duration
3438pub fn unix_timestamp ( ) -> std:: time:: Duration {
3539 let now = std:: time:: SystemTime :: now ( ) ;
You can’t perform that action at this time.
0 commit comments