-
Notifications
You must be signed in to change notification settings - Fork 87
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
Close MemoryStream if replacing with GZipStream or ZlibStream #41
Comments
This patch removes the `zlib` source from TiledSharp and relies on intrinsic .NET libraries to decompress gzip and Zlib streams. Since .NET does not have explicit Zlib support, we manually strip the header and footer, and use the `DeflateStream` on the body.
I'm wondering if this is related to our issue - bryanedds/Nu#582 |
I will gladly merge any fix or speedup that might resolve your problem. But if you would prefer to fork the repo, then that's also fine with me. (Honestly, I'm surprised it even still works in a modern .NET environemnt.) |
The perf bug plays out like some sort of n^2 algorithm on my SSD computer but not on my old HDD computer. I speculate that this is because underlying caching mechanism for these two storage devices are quite different. That said, your library is, imo, still the go-to library for .NET and Tiled. And this is even more so now that TiledCS was retired a couple years ago. If you would be willing to continue to maintain this library, I think that would be of significant benefit to the .NET community! Our project uses a custom build of TiledSharp that works otherwise flawlessly on .NET 7 and 8 and others. Perhaps other aspects of our build could be merged as well. It would be very much worth our time to make the merge request if you're willing to follow up. As things have shaken out, it actually turns out that you've got the leading .NET Tiled library - and it would be a favor to all of us if you'd be willing to continue to support it! |
Currently, when using encoded data, we will open the base64 data and convert to a
MemoryStream
which is saved toData
. However, if the data is compressed, then we create a new stream and setData
to it without closing the originalMemoryStream
.This should be fixed up in some way, either explicit closing the
MemoryStream
or not reusing theData
variable.The text was updated successfully, but these errors were encountered: