Skip to content

eval_updates should not wake up each client connection task #2783

@joshua-spacetime

Description

@joshua-spacetime

Right now, eval_updates calls ClientConnectionSender::send_message for each client receiving table updates which wakes up a task for each client. This is a lot of overhead while holding the tx lock.

We could instead push all of the table updates to a single worker task in one shot and have that task call ClientConnectionSender::send_message for each client. This would release the tx sooner because we only have to wake up a single task. It would also delay waking up the client tasks immediately which would avoid starvation of the next tx task.

Note, everything after the memo_encode in eval_updates, i.e. the bsatn serialization, should be moved to the worker or client tasks and out of eval_updates so that we release the tx as soon as possible.

Protocol::Binary => Bsatn(memo_encode::<BsatnFormat>(

Metadata

Metadata

Assignees

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