-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
415f37b
commit 3586fd9
Showing
4 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
# How does it work? | ||
Before I answer the question, I would like to raise another question: How does it work differently and more effective than the current `StringBuilder`? | ||
Before I answer the question, I would like to raise another question: How does it work differently and more effectively than the current `StringBuilder`? | ||
|
||
The basic idea is to use a `ref struct` which enforces that the `ValueStringBuilder` will life on the **stack** instead of the **heap**. | ||
Furthermore we try to use advanced features like `Span<T>` and `ArrayPool` to reduce allocations even further. Because of the way C# / .NET is optimized for those types the `ValueStringBuilder` gains a lot of speed with low allocations. | ||
|
||
With this approach some limitations arise. Head over to the [known limitation](xref:known_limitations) to know more. | ||
The basic idea is to use a `ref struct` which enforces that the `ValueStringBuilder` will live on the **stack** instead of the **heap**. | ||
Furthermore, we try to use advanced features like `Span<T>` and `ArrayPool` to reduce allocations even further. Because of the way C# / .NET is optimized for those types the `ValueStringBuilder` gains a lot of speed with low allocations. | ||
With this approach, some limitations arise. Head over to the [known limitation](xref:known_limitations) to know more. | ||
|
||
## Resources: | ||
[Here](https://steven-giesel.com/blogPost/4cada9a7-c462-4133-ad7f-e8b671987896) is my detailed blog post about some of the implementation details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters