Skip to content

Reimplement: Add Zstd compression to the websocket messages #4797

@clockwork-labs-bot

Description

@clockwork-labs-bot

This issue tracks reimplementation of the work from stale PR #2846, which is being closed because it is too out of date to merge directly.

    Original PR: https://github.com/clockworklabs/SpacetimeDB/pull/2846
    Original author: @ResuBaka
    Original branch: `zstd-websocket-compression`
    Base branch: `master`

    ## Original PR summary

    # Description of Changes

This add the option to the websocket/subscribe endpoint so you can use Zstd as the compression in addition to None/Brotli/Gzip.

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

  • I have tested it with the simple chat example where I have enabled the zstd compression and added some logging to see if it was used
  • Testing for the compression speed to find the best level

Additional

What we could look into is to use zstd dictionary features to improve the performance even more as it could possible help with the base structure of each message. The only thing that would then needed to be done is have an extra option in the enum as an ZstdDict as the client and server would need to know about the dictionary.

    ## Follow-up

    - Reimplement this change in a fresh PR against current `master`.
    - Carry forward any still-relevant context from the original PR discussion and review.
    - Link the new implementation PR back to the original stale PR for historical context.

Metadata

Metadata

Assignees

No one assigned

    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