Repository navigation
Conversation
Lyptik
marked this pull request as ready for review
October 6, 2026 07:28
This file contains hidden or 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
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.
Why
Compressed tracking data currently calls
new Decompressor().Unwrap(...)for every frame.ZstdNet.Decompressorowns a nativeZSTD_DCtxand implementsIDisposable. Creating one per frame without disposing it immediately pushes native cleanup onto the finalizer thread. At 30–60 Hz, especially with point clouds, this can create significant native-memory pressure and GC/finalizer churn.The current
Unwrapoverload also allocates a new decompressedbyte[]for every compressed frame.Changes
Shutdown()Client<TVector3>implementIDisposablefor clients discarded without an explicit shutdownMemory behavior
Before:
After:
Memory is therefore bounded by the client's largest decompressed frame rather than by allocation/finalizer lag.
Compatibility
Shutdown()remains reusable: a later compressed session lazily creates a fresh decompression context