-
Notifications
You must be signed in to change notification settings - Fork 7
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
Modernize zlib #38
Merged
Merged
Modernize zlib #38
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lacyway
previously approved these changes
Sep 24, 2024
nexus4880
approved these changes
Oct 2, 2024
Lacyway
approved these changes
Oct 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
.NET has it's own implementation of
ZlibStream
, but it's only available since .NET 6. It uses P/Invoke-ed Intels variant of zlib. Since this won't be usable within EFT, there are a variety of C# managed zlib libraries out there that we could. Here is a quick overview of the situation:ComponentAce.Compression.Libs.zlib
Elskom/zlib.managed:1.1.4.0
contains fixes to the above and is the most up to date.Elskom/zlib.managed:main
is the most modernized, throws and exception when deflating (System.InvalidOperationException in Deflate.Compress Elskom/zlib.managed#182)bsg.componentace.compression.libs.zlib
usesArrayPool
andMicrosoft.Extensions.ObjectPool
SixLabors/ZlibStream:main
refactored the codebase but is WIPComponentAce.Compressions.Libs.zlib
Currently we are using
Elskom/zlib.managed:1.1.4.0
, but there is plenty of room to improve the codebase. Due to compatability constraints of EFT's implementation of zlib, I believe the best option here is to modernize our implementation of zlib.Goals
Elskom/zlib.managed:main
SixLabors/ZlibStream:main
as inspirationbsg.componentace.compression.libs.zlib
to improve EFT's performanceChanges
Span<T>
,ReadOnlySpan<T>
SimpleZlib
(a wrapper aroundMemoryZlib
)ZOutputStream
fromComponentAce.Compression.Libs.Zlib
toElskom.Generic.Libs
Fuyu.Common.Compression.Zlib
toMemoryZlib
, moved toZlib.Managed
Fuyu.Common.Compression.ZlibCompression
toCompressionLevel
, moved toZlib.Managed
Deflate.ConfigTable
toDictionary<CompressionLevel, Config>
Elskom.Generic.Libs
(not used internally)