Skip to content

Releases: kzdev-net/kzdev.perfutils

KZDev.PerfUtils package v3.0.1

16 Apr 09:27

Choose a tag to compare

This revision focuses on base-class access modifiers and documentation updates.

  • Fixed a few erroneous MemoryStreamSlim access modifiers
  • Updated related documentation and other documentation filter changes

KZDev.PerfUtils package v3.0.0

14 Apr 13:46

Choose a tag to compare

KZDev.PerfUtils v3 focuses on MemoryStreamSlim API evolution, behavioral alignment with BCL disposal semantics, and expanded modern framework support.

Highlights

  • Added MemoryStreamSlim.ToMemory() and MemoryStreamSlim.ToMemory(MemoryPool<byte>) for pooled, contiguous Memory<byte> export via IMemoryOwner<byte>.
  • Improved MemoryStreamSlim compatibility with BCL MemoryStream disposed behavior for dynamic-mode streams (Length, Position, and capacity APIs now throw ObjectDisposedException after dispose).
  • Updated framework support for the 3.x line: targets net8.0, net9.0, and net10.0 (older TFMs, including .NET 6, are no longer shipped).

Breaking Changes

MemoryStreamSlim disposed behavior (dynamic mode)
For dynamic-mode streams (segment/pool-backed instances created without a caller-supplied buffer), the following members now throw ObjectDisposedException after disposal:

  • Length
  • Position (get/set)
  • Capacity (get/set)
  • CapacityLong (get/set)

If existing code accessed these members after Dispose(), update that flow to capture values before disposal.

Behavioral Improvement

Fixed mode ToArray() after disposal

For fixed-mode streams (wrapping a caller-provided buffer), ToArray() now behaves like BCL MemoryStream and is allowed after disposal.

Notes on ToMemory()

  • Returns a contiguous owner-backed buffer (IMemoryOwner<byte>) spanning visible bytes from 0..Length.
  • Uses shared pool by default, or a caller-provided pool.
  • For non-empty payloads, callers should Dispose() the returned owner to return rented buffers.
  • Integrates with dedicated observability events for ToMemory materialization.

KZDev.PerfUtils package v2.0.1

01 May 10:24

Choose a tag to compare

This release of the 'KZDev.PerfUtils' package fixes a potential internal race condition that could lead to an index out of range exception.

KZDev.PerfUtils package v2.0.0

23 Apr 10:31

Choose a tag to compare

This release of the 'KZDev.PerfUtils' package:

  • Introduces several compression helper classes that use MemoryStreamSlim as the compression destination for improved performance.
  • Adds targeted support for .NET 9
  • MemoryStreamSlim supports int64 (long) sized streams.

KZDev.PerfUtils package v1.2.0

03 Jan 12:09

Choose a tag to compare

This release of the 'KZDev.PerfUtils' package introduces the StringBuilderCache class which provides performance enhancements for frequent use of StringBuilders.
In addition, the MemoryStreamSlim class now provides internal memory trimming for memory segments that have not been used for an extended period.

KZDev.PerfUtils package v1.1.0

25 Oct 17:42

Choose a tag to compare

This release of the 'KZDev.PerfUtils' package contains some additional performance enhancements to the MemoryStreamSlim class and adds the InterlockedOps class which provides additional thread-safe atomic operations beyond those available in the Interlocked class.

KZDev.PerfUtils package v1.0.0

13 Oct 15:48
a1e2be5

Choose a tag to compare

This is the first release of the KZDev.PerfUtils package containing the MemoryStreamSlim class; a high-performance, memory-efficient, and easy-to-use replacement for the MemoryStream class that provides benefits for large or frequently used streams.