Bia.ValueBuffers
0.2.0
See the version list below for details.
dotnet add package Bia.ValueBuffers --version 0.2.0
NuGet\Install-Package Bia.ValueBuffers -Version 0.2.0
<PackageReference Include="Bia.ValueBuffers" Version="0.2.0" />
<PackageVersion Include="Bia.ValueBuffers" Version="0.2.0" />
<PackageReference Include="Bia.ValueBuffers" />
paket add Bia.ValueBuffers --version 0.2.0
#r "nuget: Bia.ValueBuffers, 0.2.0"
#:package Bia.ValueBuffers@0.2.0
#addin nuget:?package=Bia.ValueBuffers&version=0.2.0
#tool nuget:?package=Bia.ValueBuffers&version=0.2.0
Bia.ValueBuffers
High-performance, stack-first value-type buffers for .NET. Zero-allocation where possible, ArrayPool-backed overflow. Cross-platform, trimmable and AOT/NativeAOT compatible.
⭐ Please star this project if you like it. ⭐
Example | Example Catalogue | Public API
Example
// ValueStringBuilder — stack-first string building, zero allocation on the happy path
Span<char> buf = stackalloc char[128];
var sb = new ValueStringBuilder(buf);
sb.Append("Hello");
sb.Append(", ");
sb.Append("World");
sb.Append('!');
string greeting = sb.ToString(); // disposes builder and returns pooled memory
// ValueRingBuffer<T> — fixed-capacity circular buffer backed by stackalloc
Span<int> ring = stackalloc int[4];
var rb = new ValueRingBuffer<int>(ring);
rb.Write(1);
rb.Write(2);
rb.Write(3);
rb.Write(4);
rb.Write(5); // buffer is full — overwrites oldest element (1)
int oldest = rb.Read(); // returns 2 (FIFO)
_ = greeting;
_ = oldest;
For more examples see Example Catalogue.
Benchmarks
Run dotnet Build.cs comparison-bench then dotnet test to populate results locally.
Detailed Benchmarks
Comparison Benchmarks
TestBench Benchmark Results
Example Catalogue
The following examples are available in ReadMeTest.cs.
Example - Empty
// ValueStringBuilder — stack-first string building, zero allocation on the happy path
Span<char> buf = stackalloc char[128];
var sb = new ValueStringBuilder(buf);
sb.Append("Hello");
sb.Append(", ");
sb.Append("World");
sb.Append('!');
string greeting = sb.ToString(); // disposes builder and returns pooled memory
// ValueRingBuffer<T> — fixed-capacity circular buffer backed by stackalloc
Span<int> ring = stackalloc int[4];
var rb = new ValueRingBuffer<int>(ring);
rb.Write(1);
rb.Write(2);
rb.Write(3);
rb.Write(4);
rb.Write(5); // buffer is full — overwrites oldest element (1)
int oldest = rb.Read(); // returns 2 (FIFO)
_ = greeting;
_ = oldest;
Public API Reference
See docs/PublicApi.md for the complete auto-generated public API reference.
Note:
docs/PublicApi.mdis auto-updated by theReadMeTest_PublicApitest on everydotnet testrun. Do not edit it manually.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bia.ValueBuffers:
| Package | Downloads |
|---|---|
|
Maple.Text
MapleStory rich-text parsing: tokenizes and strips MapleStory custom markup for use in UI text rendering. Cross-platform, trimmable and AOT/NativeAOT compatible. |
GitHub repositories
This package is not used by any popular GitHub repositories.