Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bindings/napi/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn init(old_ref_count: u32) !void {
var cpu_count: u64 = options.thread_count;
if (options.thread_count == 0) {
cpu_count = @max(try detectCpuCount(), 2) - 1;
std.debug.print(
std.log.debug(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a intentional print info, not a log?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it's a question of if we should make this be configurable from lodestar. I think even previously with the rust bindings this thread count was silently set on the library side, which isn't ideal but that was the way it worked. Otherwise it comes up as a weird unconfigurable option that logs as noise to the user

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it

"Note: no -Dthread-count set, using cgroup-aware CPU count minus 1: {}\n",
.{cpu_count},
);
Expand All @@ -44,7 +44,7 @@ fn init(old_ref_count: u32) !void {
/// count (what `std.Thread.getCpuCount()` reports).
fn detectCpuCount() !usize {
return @import("cpu_count").getNumCpus(allocator, napi_io.get()) catch |err| {
std.debug.print(
std.log.debug(
"Warning: cgroup CPU detection failed ({s}), using affinity count\n",
.{@errorName(err)},
);
Expand Down
Loading