LinkDotNet.StringBuilder
0.9.0
See the version list below for details.
dotnet add package LinkDotNet.StringBuilder --version 0.9.0
NuGet\Install-Package LinkDotNet.StringBuilder -Version 0.9.0
<PackageReference Include="LinkDotNet.StringBuilder" Version="0.9.0" />
paket add LinkDotNet.StringBuilder --version 0.9.0
#r "nuget: LinkDotNet.StringBuilder, 0.9.0"
// Install LinkDotNet.StringBuilder as a Cake Addin #addin nuget:?package=LinkDotNet.StringBuilder&version=0.9.0 // Install LinkDotNet.StringBuilder as a Cake Tool #tool nuget:?package=LinkDotNet.StringBuilder&version=0.9.0
StringBuilder
A fast and low allocation StringBuilder for .NET.
Getting Started
Install the package:
PM> Install-Package LinkDotNet.StringBuilder
Afterwards use the package as follow:
ValueStringBuilder stringBuilder = new ValueStringBuilder();
stringBuilder.AppendLine("Hello World");
string result = stringBuilder.ToString();
What does it solve?
The dotnet version of the StringBuilder
is a all purpose version which normally fits a wide variety of needs.
But sometimes low allocation is key. Therefore I created the ValueStringBuilder
. It is not a class but a ref struct
which tries to do as less allocations as possible.
If you want to know how the ValueStringBuilder
works and why it uses allocations and is even faster, checkout this blog post.
The blog goes a bit more in detail how it works with a simplistic version of the ValueStringBuilder
.
Benchmark
The following table gives you a small comparison between the StringBuilder
which is part of .NET and the ValueStringBuilder
:
| Method | Mean | Error | StdDev | Gen 0 | Allocated |
|-------------------- |---------:|--------:|--------:|-------:|----------:|
| DotNetStringBuilder | 430.7 ns | 8.52 ns | 7.55 ns | 0.3576 | 1,496 B |
| ValueStringBuilder | 226.7 ns | 2.45 ns | 2.05 ns | 0.1395 | 584 B |
Checkout the Benchmark for more detailed comparison and setup.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LinkDotNet.StringBuilder:
Package | Downloads |
---|---|
DccUtils.TypeFormatting
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.21.1 | 34 | 11/8/2024 |
1.21.0 | 914 | 9/20/2024 |
1.20.0 | 8,823 | 5/2/2024 |
1.19.1 | 221 | 4/19/2024 |
1.19.0 | 5,284 | 3/2/2024 |
1.18.6 | 5,069 | 11/3/2023 |
1.18.5 | 2,383 | 10/19/2023 |
1.18.4 | 380 | 10/14/2023 |
1.18.3 | 4,042 | 9/22/2023 |
1.18.2 | 255 | 9/8/2023 |
1.18.1 | 32,543 | 8/10/2023 |
1.18.0 | 24,121 | 6/8/2023 |
1.17.0 | 3,269 | 4/13/2023 |
1.16.0 | 371 | 3/28/2023 |
1.15.0 | 219 | 3/26/2023 |
1.14.0 | 243 | 3/25/2023 |
1.13.1 | 312 | 3/17/2023 |
1.13.0 | 37,165 | 3/4/2023 |
1.12.2 | 291 | 2/21/2023 |
1.12.0 | 905 | 1/9/2023 |
1.11.5 | 334 | 1/9/2023 |
1.11.4 | 336 | 1/7/2023 |
1.11.3 | 333 | 1/3/2023 |
1.11.2 | 335 | 1/3/2023 |
1.11.1 | 350 | 1/1/2023 |
1.11.0 | 330 | 1/1/2023 |
1.10.6 | 330 | 12/30/2022 |
1.10.5 | 319 | 12/29/2022 |
1.10.4 | 359 | 12/27/2022 |
1.10.3 | 327 | 12/26/2022 |
1.10.2 | 367 | 12/16/2022 |
1.10.1 | 402 | 11/28/2022 |
1.10.0 | 386 | 11/20/2022 |
1.9.0 | 387 | 11/18/2022 |
1.8.0 | 379 | 11/15/2022 |
1.7.0 | 376 | 11/12/2022 |
1.6.2 | 392 | 11/11/2022 |
1.6.1 | 401 | 11/11/2022 |
1.6.0 | 369 | 11/10/2022 |
1.5.1 | 392 | 11/5/2022 |
1.5.0 | 379 | 11/5/2022 |
1.4.1 | 402 | 11/4/2022 |
1.4.0 | 482 | 10/11/2022 |
1.3.0 | 475 | 7/25/2022 |
1.2.0 | 535 | 4/20/2022 |
1.1.0 | 507 | 4/16/2022 |
1.0.1 | 475 | 4/13/2022 |
1.0.0 | 483 | 4/12/2022 |
0.9.5 | 468 | 4/10/2022 |
0.9.4 | 504 | 4/9/2022 |
0.9.3 | 480 | 4/9/2022 |
0.9.2 | 467 | 4/7/2022 |
0.9.1 | 468 | 4/6/2022 |
0.9.0 | 508 | 4/4/2022 |