Skip to content

Consider simplifying async usage #6741

@LesnyRumcajs

Description

@LesnyRumcajs

Summary

Inspiration material: https://www.youtube.com/watch?v=lJmRf9EejU4&list=PL8NC5lCgGs6MnMLJvhFH2jLa8bLYwCzmI&index=12

The gist of this is that we could potentially improve readability of the code without impacting performance (it might even fare better) if we explore some options:

  • using https://docs.rs/moro/latest/moro/macro.async_scope.html instead of putting Arc's everywhere
  • switching to some thread-per-core strategy; this would ease lots of constraints on Send that we have internally, potentially simplifying code and improving performance as well (less synchronization mechanisms). Not sure if it's possible with tokio, there's https://github.com/DataDog/glommio but it'd be huge amount of work to refactor things given our frequent usage of tokio utils.

Completion Criteria

  • Investigate either of the approaches and see if it brings any benefits; the first one with moro should be a quick win

Additional Links & Resources

https://emschwartz.me/async-rust-can-be-a-pleasure-to-work-with-without-send-sync-static/

Metadata

Metadata

Assignees

Labels

Type: TaskDiscrete task to implement

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions