Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

akiraveliara
Copy link
Member

@akiraveliara akiraveliara commented Jul 11, 2024

This pull request completely rewrites how gateway compression works and adds zstd support. Previously, gateway compression went through a PayloadDecompressor pulling the current compression mode from the configuration; now we register a different compression service based on the determined compression mode. This supports a default selection as outlined in the new documentation; attempting to load zstd and falling back to zlib if zstd is unavailable.

This pull request improves zlib performance somewhat, especially zlib-payload (which is no longer a default-recommended option due to its many shortcomings as payload-wise decompression). Zstd performs considerably better due to not needing to copy memory or make temporary allocations beyond what the native implementation requires.

closes #2015

@akiraveliara akiraveliara added this to the v5.0 milestone Jul 11, 2024
@akiraveliara akiraveliara mentioned this pull request Jul 11, 2024
36 tasks
@akiraveliara akiraveliara marked this pull request as ready for review December 10, 2024 18:09
Copy link
Member

@VelvetToroyashi VelvetToroyashi left a comment

Choose a reason for hiding this comment

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

I've only briefly looked over it - I do have questions (e.g. the payload decompressor seemingly being added twice?) but nothing blocking.

Copy link
Contributor

@OoLunar OoLunar left a comment

Choose a reason for hiding this comment

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

LGTM, just nitpicks

DSharpPlus/Net/Gateway/Compression/Zlib/ZlibWrapper.cs Outdated Show resolved Hide resolved
@Plerx2493 Plerx2493 merged commit c2f1b3e into master Dec 19, 2024
1 check passed
@Plerx2493 Plerx2493 deleted the aki/compression branch December 19, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to decompress a gateway payload

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.