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

Add support for zstd compressed jetstream #141

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

Soulusions
Copy link
Contributor

Simple addition of zstd compression support for jetstream, should be especially useful once more collections get added to it.
I added the ZstdSharp.Port library for actual zstd support, the dictionary is currently sitting in the root of the project as I wasn't 100% sure where to put it.
Last thing of note I guess is the slightly nasty msbuild wrestling I had to do that handle the dictionary (100% interested to know if there's a better way to do this than what I did).
Otherwise this has been working amazing from my personal testing with a personal project as well as the jetstream sample!

Copy link
Owner

@drasticactions drasticactions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

I think the library should be okay to use and in general I'm cool adding it. I think if you remove the hardcoded zst_dictionary and instead pass it in as a byte array parameter, then I'm 👍

src/FishyFlip/ATJetStream.cs Outdated Show resolved Hide resolved
@Soulusions
Copy link
Contributor Author

Also this is simply a sidenote that's not very relevant in the current state of the project/jetstream itself, but later on if more collections get added to jetstream, it might be worth looking at using the multi-threaded API for ZstdSharp as the bandwidth on the websocket might grow in the future, who knows!

@drasticactions drasticactions merged commit 20d6f32 into drasticactions:develop Jan 3, 2025
6 checks passed
@drasticactions
Copy link
Owner

It should be on Nuget now: https://www.nuget.org/packages/FishyFlip/3.2.0-alpha.4

Thanks!

@Soulusions Soulusions deleted the jetstream-zstd branch January 3, 2025 20:11
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