Skip to content

Commit

Permalink
Remove jaeger from approval-voting and approval-distribution (#5830)
Browse files Browse the repository at this point in the history
Jaeger spans were not usable for debugging, see
#4995, but we pay a
price in CPU cost, subsystem-benchmarks show this brings a reduction of
about 10-15% in CPU usage per subsystem, so remove it.

---------

Signed-off-by: Alexandru Gheorghe <[email protected]>
  • Loading branch information
alexggh authored Sep 27, 2024
1 parent 6c3219e commit 8edc2ca
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 252 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion polkadot/node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ polkadot-node-subsystem-util = { workspace = true, default-features = true }
polkadot-overseer = { workspace = true, default-features = true }
polkadot-primitives = { workspace = true, default-features = true }
polkadot-node-primitives = { workspace = true, default-features = true }
polkadot-node-jaeger = { workspace = true, default-features = true }

sc-keystore = { workspace = true }
sp-consensus = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ fn main() -> Result<(), String> {
("Sent to peers", 63995.2200, 0.01),
]));
messages.extend(average_usage.check_cpu_usage(&[
("approval-distribution", 12.2736, 0.1),
("approval-voting", 2.7174, 0.1),
("approval-distribution", 0.1, 0.1),
("approval-voting", 0.1, 0.1),
("approval-voting-parallel", 18.0758, 0.1),
]));

if messages.is_empty() {
Expand Down
9 changes: 0 additions & 9 deletions polkadot/node/core/approval-voting/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
//!
//! We maintain a rolling window of session indices. This starts as empty

use polkadot_node_jaeger as jaeger;
use polkadot_node_primitives::{
approval::{
self as approval_types,
Expand Down Expand Up @@ -348,13 +347,6 @@ pub(crate) async fn handle_new_head<
finalized_number: &Option<BlockNumber>,
) -> SubsystemResult<Vec<BlockImportedCandidates>> {
const MAX_HEADS_LOOK_BACK: BlockNumber = MAX_FINALITY_LAG;
let _handle_new_head_span = state
.spans
.get(&head)
.map(|span| span.child("handle-new-head"))
.unwrap_or_else(|| jaeger::Span::new(head, "handle-new-head"))
.with_string_tag("head", format!("{:?}", head))
.with_stage(jaeger::Stage::ApprovalChecking);

let header = {
let (h_tx, h_rx) = oneshot::channel();
Expand Down Expand Up @@ -666,7 +658,6 @@ pub(crate) mod tests {
slot_duration_millis: 6_000,
clock: Arc::new(MockClock::default()),
assignment_criteria: Box::new(MockAssignmentCriteria::default()),
spans: HashMap::new(),
per_block_assignments_gathering_times: LruMap::new(ByLength::new(
MAX_BLOCKS_WITH_ASSIGNMENT_TIMESTAMPS,
)),
Expand Down
Loading

0 comments on commit 8edc2ca

Please sign in to comment.