Skip to content

perf(rpc): drop debug traces in a blocking task#7063

Closed
DaniPopes wants to merge 1 commit intomainfrom
dani/drop-task-debug
Closed

perf(rpc): drop debug traces in a blocking task#7063
DaniPopes wants to merge 1 commit intomainfrom
dani/drop-task-debug

Conversation

@DaniPopes
Copy link
Member

As discussed, 10-15% of the time spent in debug rpc calls is just dropping the trace arena when stack is enabled.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this would certainly speed up a single request, unclear how this performs if the node is at max CPU

we could also try reusing the inspector across multiple runs when tracing block and not dropping it by only clearing it

Comment on lines +557 to +560
let geth_builder = inspector.into_geth_builder();
let frame =
geth_builder.geth_call_traces(call_config, res.result.gas_used());
self.drop_in_task(geth_builder);
Copy link
Collaborator

Choose a reason for hiding this comment

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

with #7063

the call+prestate tracer lo longer record any stack+memory so I think we can get away without handling these

Comment on lines -571 to +579
db,
)?;
let geth_builder = inspector.into_geth_builder();
let frame = geth_builder.geth_prestate_traces(&res, prestate_config, db)?;
self.drop_in_task(geth_builder);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this could spawn >200 drop tasks per request when tracing an entire block.
unsure about the sideeffects when the node is under heavy load

@gakonst
Copy link
Member

gakonst commented Mar 8, 2024

I think we maybe try Seitz's fixes first, given they're obviously safe, and we can do this as follow-up if we're not #1 in trace perf then?

@DaniPopes DaniPopes marked this pull request as draft March 9, 2024 10:39
@DaniPopes DaniPopes closed this Mar 19, 2024
@DaniPopes DaniPopes deleted the dani/drop-task-debug branch September 27, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants