Skip to content

Commit

Permalink
Make RAKUDO_SCHEDULER_DEBUG_STATUS logging leaner
Browse files Browse the repository at this point in the history
Not functional changes, just *if* you are doing this, it will have
slightly less impact on overal performance.
  • Loading branch information
lizmat committed Jan 19, 2021
1 parent e7a46bc commit aa9e849
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/core.c/ThreadPoolScheduler.pm6
Expand Up @@ -7,7 +7,7 @@ my class ThreadPoolScheduler does Scheduler {
# Initialize $*PID here, as we need it for the debug message
# anyway *and* it appears to have a positive effect on stability
# specifically wrt GH #1202.
PROCESS::<$PID> := nqp::p6box_i(my $pid := nqp::getpid);
PROCESS::<$PID> := nqp::p6box_i(my int $pid = nqp::getpid);

# Scheduler debug, controlled by an environment variable.
my int $scheduler-debug = so %*ENV<RAKUDO_SCHEDULER_DEBUG>;
Expand All @@ -17,11 +17,6 @@ my class ThreadPoolScheduler does Scheduler {
note "[SCHEDULER $pid] $message";
}
}
sub scheduler-debug-status($message --> Nil) {
if $scheduler-debug-status {
note "[SCHEDULER $pid] $message";
}
}

# Infrastructure for non-blocking `await` for code running on the
# scheduler.
Expand Down Expand Up @@ -669,7 +664,7 @@ my class ThreadPoolScheduler does Scheduler {
$smooth-per-core-util += $per-core-util;
@last-utils.push($per-core-util);
#?endif
scheduler-debug-status "Per-core utilization (approx): $smooth-per-core-util%"
note "[SCHEDULER $pid] Per-core utilization (approx): $smooth-per-core-util%"
if $scheduler-debug-status;

# exhausted the system allotment of low level threads
Expand Down

0 comments on commit aa9e849

Please sign in to comment.