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

Close MemoryStream if replacing with GZipStream or ZlibStream #41

Open
marshallward opened this issue Nov 23, 2016 · 3 comments
Open

Close MemoryStream if replacing with GZipStream or ZlibStream #41

marshallward opened this issue Nov 23, 2016 · 3 comments

Comments

@marshallward
Copy link
Owner

Currently, when using encoded data, we will open the base64 data and convert to a MemoryStream which is saved to Data. However, if the data is compressed, then we create a new stream and set Data to it without closing the original MemoryStream.

This should be fixed up in some way, either explicit closing the MemoryStream or not reusing the Data variable.

marshallward referenced this issue Dec 9, 2016
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.
@bryanedds
Copy link

I'm wondering if this is related to our issue - bryanedds/Nu#582

@marshallward
Copy link
Owner Author

marshallward commented Apr 16, 2024

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.)

@bryanedds
Copy link

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!

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

No branches or pull requests

2 participants