File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ license = "Unlicense/MIT"
1010exclude = [" ../.vscode/*" , " ../Dockerfile" , " ../Makefile" , " ../.editorConfig" ]
1111edition = " 2018"
1212
13+ [features ]
14+ profiler = [" measureme" , " once_cell" ]
15+
1316[dependencies ]
1417gc = { version = " 0.3.5" , features = [" derive" ] }
1518serde_json = " 1.0.53"
@@ -21,9 +24,9 @@ num-bigint = { version = "0.2.6", features = ["serde"] }
2124
2225# Optional Dependencies
2326serde = { version = " 1.0.110" , features = [" derive" ], optional = true }
27+ measureme = { version = " 0.7.1" , optional = true }
28+ once_cell = { version = " 1.4.0" , optional = true }
2429bitflags = " 1.2.1"
25- measureme = { version = " 0.7.1" }
26- once_cell = " 1.4.0"
2730
2831[dev-dependencies ]
2932criterion = " 0.3.2"
Original file line number Diff line number Diff line change 11#![ allow( missing_copy_implementations, missing_debug_implementations) ]
22
3+ #[ cfg( feature = "profiler" ) ]
34use measureme:: { EventId , Profiler , TimingGuard } ;
5+ #[ cfg( feature = "profiler" ) ]
46use once_cell:: sync:: OnceCell ;
57use std:: fmt:: { self , Debug } ;
8+ #[ cfg( feature = "profiler" ) ]
69use std:: {
710 path:: Path ,
811 thread:: { current, ThreadId } ,
@@ -11,14 +14,17 @@ use std::{
1114/// MmapSerializatioSink is faster on macOS and Linux
1215/// but FileSerializationSink is faster on Windows
1316#[ cfg( not( windows) ) ]
17+ #[ cfg( feature = "profiler" ) ]
1418type SerializationSink = measureme:: MmapSerializationSink ;
1519#[ cfg( windows) ]
20+ #[ cfg( feature = "profiler" ) ]
1621type SerializationSink = measureme:: FileSerializationSink ;
1722#[ cfg( feature = "profiler" ) ]
1823pub struct BoaProfiler {
1924 profiler : Profiler < SerializationSink > ,
2025}
2126
27+ #[ cfg( feature = "profiler" ) ]
2228pub static mut INSTANCE : OnceCell < BoaProfiler > = OnceCell :: new ( ) ;
2329
2430#[ cfg( feature = "profiler" ) ]
You can’t perform that action at this time.
0 commit comments