perf(runtime): reduce worker I/O overhead in multiprocess mode
This commit is contained in:
@@ -123,7 +123,9 @@ int run_mining_loop(const MinerConfig *cfg, int worker_idx, const char *extranon
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event_fd < 0) {
|
||||||
fprintf(stdout, "[main] chain=%s worker=%d extranonce2=%s\n", chain, worker_idx, extranonce2);
|
fprintf(stdout, "[main] chain=%s worker=%d extranonce2=%s\n", chain, worker_idx, extranonce2);
|
||||||
|
}
|
||||||
|
|
||||||
status_ctx.event_fd = event_fd;
|
status_ctx.event_fd = event_fd;
|
||||||
status_ctx.worker_idx = worker_idx;
|
status_ctx.worker_idx = worker_idx;
|
||||||
@@ -164,7 +166,9 @@ int run_mining_loop(const MinerConfig *cfg, int worker_idx, const char *extranon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event_fd < 0) {
|
||||||
fprintf(stdout, "[main] template height=%d tx=%zu segwit=%d\n", tpl.height, tpl.tx_count, witness_count);
|
fprintf(stdout, "[main] template height=%d tx=%zu segwit=%d\n", tpl.height, tpl.tx_count, witness_count);
|
||||||
|
}
|
||||||
|
|
||||||
if (build_coinbase_transaction(
|
if (build_coinbase_transaction(
|
||||||
&tpl,
|
&tpl,
|
||||||
@@ -243,7 +247,7 @@ int run_mining_loop(const MinerConfig *cfg, int worker_idx, const char *extranon
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atomic_load(&new_block_flag) != 0) {
|
if (event_fd < 0 && atomic_load(&new_block_flag) != 0) {
|
||||||
fprintf(stdout, "[main] nuovo best block: riavvio ciclo\n");
|
fprintf(stdout, "[main] nuovo best block: riavvio ciclo\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +287,9 @@ int run_mining_loop(const MinerConfig *cfg, int worker_idx, const char *extranon
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (block_hash != NULL) {
|
if (block_hash != NULL) {
|
||||||
|
if (event_fd < 0) {
|
||||||
fprintf(stdout, "[main] block trovato: %s\n", block_hash);
|
fprintf(stdout, "[main] block trovato: %s\n", block_hash);
|
||||||
|
}
|
||||||
emit_eventf(event_fd, "found %d %.6f\n", worker_idx, result.hashrate_hz / 1000.0);
|
emit_eventf(event_fd, "found %d %.6f\n", worker_idx, result.hashrate_hz / 1000.0);
|
||||||
emit_eventf(event_fd, "hash %d %s\n", worker_idx, block_hash);
|
emit_eventf(event_fd, "hash %d %s\n", worker_idx, block_hash);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user