File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ The library works best for a small to medium amount of strings (not multiple 100
3131A more detailed documentation can be found [ here] ( https://linkdotnet.github.io/StringBuilder/ ) .
3232
3333## Benchmark
34+
3435The following table gives you a small comparison between the ` StringBuilder ` which is part of .NET and the ` ValueStringBuilder ` :
3536
3637``` no-class
@@ -40,4 +41,14 @@ The following table gives you a small comparison between the `StringBuilder` whi
4041| ValueStringBuilder | 226.7 ns | 2.45 ns | 2.05 ns | 0.1395 | 584 B |
4142```
4243
44+ Another benchmark shows that this ` ValueStringBuilder ` uses less memory when it comes to appending ` ValueTypes ` such as ` int ` , ` double ` , ...
45+
46+ ``` no-class
47+ | Method | Mean | Error | StdDev | Gen 0 | Allocated |
48+ |-------------------- |---------:|---------:|---------:|-------:|----------:|
49+ | DotNetStringBuilder | 17.21 us | 0.622 us | 1.805 us | 1.5259 | 6 KB |
50+ | ValueStringBuilder | 16.24 us | 0.496 us | 1.462 us | 0.3357 | 1 KB |
51+
52+ ```
53+
4354Checkout the [ Benchmark] ( tests/LinkDotNet.StringBuilder.Benchmarks ) for more detailed comparison and setup.
You can’t perform that action at this time.
0 commit comments