Skip to content

statement-store: do_propagate_statements takes unusual long time #10738

@alexggh

Description

@alexggh

Notice do_propagate_statements takes in the oder of seconds, when dealing with a lot of statements (100k)

Do propagate took 4377 ms
Do propagate took 4998 ms
Do propagate took 4703 ms

This is bad for a few reasons:

  1. It slows the propagation to other peers.
  2. It keeps the main loop busy for this amount of time.

The main culprit for this is this line of code:

let encoded_size = chunk.encoded_size();
, which repeatedly encodes all statements after each chunk send.

The fix is to pick a chunk size, so that on the hot path, we don't have repeatedly encode all statements we want send in a loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions