Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Using Rust in Synapse #12164

@erikjohnston

Description

@erikjohnston

There is a general desire to have the option to write some code in Rust, especially performance sensitive code. Currently Synapse can optionally use the https://github.com/erikjohnston/rust-jaeger-python-client library when connecting to Jaeger, however we expect future Rust components would not be optional (to avoid having to maintain the same code in two different languages).

Some things that we need to figure out before we can start doing this:

  • Ensure that our package build systems correctly work with Rust dependencies.
  • Where we keep the Rust code, and how we hook it into Synapse (e.g. is it in the same repo, are the Rust modules done as a separate python library, etc)
  • How to hook Rust logging into python logging (probably pyo3-log will just work)
  • How to call async functions to/from Rust (will pyo3-asyncio just work? Does it need us to use the asyncio reactor?)
  • How do we handle log contexts? How do we record CPU usage in Rust?

Ideally we'd start with a trivial module as a PoC before tackling anything larger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Z-Dev-WishlistMakes developers' lives better, but doesn't have direct user impactrustPull requests that update Rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions