Check for log level before doing perf counter work

Perf counters, especially when running the dynamic test can cause
functions like crdt::apply_updates to be really slow (>500ms).
This commit is contained in:
Stephen Akridge
2018-08-06 18:35:45 +00:00
committed by sakridge
parent c64e2acf8b
commit 38be61bd22
11 changed files with 70 additions and 51 deletions

View File

@@ -5,6 +5,7 @@
//!
use counter::Counter;
use log::Level;
use packet::{Packet, SharedPackets};
use std::mem::size_of;
use std::sync::atomic::AtomicUsize;
@@ -97,7 +98,7 @@ pub fn ed25519_verify_cpu(batches: &[SharedPackets]) -> Vec<Vec<u8>> {
.collect()
})
.collect();
inc_new_counter!("ed25519_verify", count);
inc_new_counter_info!("ed25519_verify", count);
rv
}
@@ -116,7 +117,7 @@ pub fn ed25519_verify_disabled(batches: &[SharedPackets]) -> Vec<Vec<u8>> {
.collect()
})
.collect();
inc_new_counter!("ed25519_verify", count);
inc_new_counter_info!("ed25519_verify", count);
rv
}
@@ -203,7 +204,7 @@ pub fn ed25519_verify(batches: &[SharedPackets]) -> Vec<Vec<u8>> {
num += 1;
}
}
inc_new_counter!("ed25519_verify", count);
inc_new_counter_info!("ed25519_verify", count);
rvs
}