You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dotnet version of the `StringBuilder` is an all-purpose version that normally fits a wide variety of needs.
33
-
But sometimes low allocation is key. Therefore I created the `ValueStringBuilder`. It is not a class but a `ref struct` that tries to do as less allocations as possible.
33
+
But sometimes, low allocation is key. Therefore I created the `ValueStringBuilder`. It is not a class but a `ref struct` that tries to allocate as little as possible.
34
34
If you want to know how the `ValueStringBuilder` works and why it uses allocations and is even faster, check out [this](https://steven-giesel.com/blogPost/4cada9a7-c462-4133-ad7f-e8b671987896) blog post.
35
35
The blog goes into a bit more in detail about how it works with a simplistic version of the `ValueStringBuilder`.
36
36
37
37
## What it doesn't solve!
38
38
The library is not meant as a general replacement for the `StringBuilder` shipped with the .net framework itself. You can head over to the documentation and read about the ["Known limitations"](https://linkdotnet.github.io/StringBuilder/articles/known_limitations.html).
39
-
The library works best for a small to medium amount of strings (not multiple 100'000 characters, even though it can be still faster and uses fewer allocations). At any time you can convert the `ValueStringBuilder` to a "normal" `StringBuilder` and vice versa.
39
+
The library works best for a small to medium amount of strings (not multiple 100'000 characters, even though it can be still faster and uses fewer allocations). At any time, you can convert the `ValueStringBuilder` to a "normal" `StringBuilder` and vice versa.
40
40
41
41
The normal use case is to add concatenate strings in a hot path where the goal is to put as minimal pressure on the GC as possible.
42
42
@@ -45,7 +45,7 @@ More detailed documentation can be found [here](https://linkdotnet.github.io/Str
45
45
46
46
## Benchmark
47
47
48
-
The following table gives you a small comparison between the `StringBuilder` which is part of .NET, [`ZString`](https://github.com/Cysharp/ZString) and the `ValueStringBuilder`:
48
+
The following table gives you a small comparison between the `StringBuilder` which is part of .NET, [`ZString`](https://github.com/Cysharp/ZString) and, the `ValueStringBuilder`:
0 commit comments