mirror of
https://github.com/fluencelabs/aquavm
synced 2024-12-04 15:20:16 +00:00
Get rid of unconditional logging code (#276)
The `log_instruction` macro unconditionally pre-formatted some string to be logged, even if logging is disabled, making whole AquaVM very slow. After getting it fixed, native execution time dropped from 5sec to thousands of milliseconds.
This commit is contained in:
parent
6df2b9d084
commit
090eceef85
@ -94,16 +94,21 @@ impl<'i> ExecutableInstruction<'i> for Instruction<'i> {
|
||||
#[macro_export]
|
||||
macro_rules! log_instruction {
|
||||
($instr_name:expr, $exec_ctx:expr, $trace_ctx:expr) => {
|
||||
use std::fmt::Write as _;
|
||||
log::debug!(target: air_log_targets::INSTRUCTION, "> {}", stringify!($instr_name));
|
||||
log::debug!(
|
||||
target: air_log_targets::INSTRUCTION,
|
||||
"> {}",
|
||||
stringify!($instr_name)
|
||||
);
|
||||
|
||||
let mut variables = String::from(" scalars:");
|
||||
write!(variables, "\n {}", $exec_ctx.scalars).unwrap();
|
||||
|
||||
write!(variables, " streams:").unwrap();
|
||||
write!(variables, "\n {}", $exec_ctx.streams).unwrap();
|
||||
|
||||
log::trace!(target: air_log_targets::DATA_CACHE, "{}", variables);
|
||||
log::trace!(
|
||||
target: air_log_targets::DATA_CACHE,
|
||||
" scalars:
|
||||
{}
|
||||
streams:
|
||||
{}",
|
||||
$exec_ctx.scalars,
|
||||
$exec_ctx.streams
|
||||
);
|
||||
log::trace!(
|
||||
target: air_log_targets::NEXT_PEER_PKS,
|
||||
" next peers pk: {:?}",
|
||||
|
Loading…
Reference in New Issue
Block a user