Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-Copy Deserialization of Events #214

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

Zero-Copy Deserialization of Events #214

wants to merge 35 commits into from

Conversation

TTWNO
Copy link
Member

@TTWNO TTWNO commented Dec 1, 2024

This will be a (likely long-running) PR with the eventual goal to get all user-facing event-types (UEFTs) to be created without allocating once we receive the zbus::Message type.

This current depends on a few facts that need further work:

  1. A way to deserialize borrowed bodies (current not working).
  2. A way to directly access information from a zbus::Message without using Clone:
    • Signature
    • ObjectPath (path)
    • UnqiueName (sender)
    • Body
    • and preferably without using locking.... I'm looking at you LazyLock<QuickFields> field in zbus::Message

This should improve performance, as initial evidence has shown.

Note that this also depends on the zbus-5.0 branch getting merged.

TTWNO and others added 5 commits November 25, 2024 00:12
- Change most `Message::body()` (which clones and allocates) into
  `Message::into_body()` which takes ownership of `self` and does not
  allocate.
- Still not possible for borrowed `MessageConversionBorrow::Body` types,
  so still WIP there.
We were cloning in the inner loop of our benchmark.
This meant we were also measuring syscall latencies of malloc.
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.

2 participants