Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aelij/spanify
Span-ify your code: write high performance memory aware C#
https://github.com/aelij/spanify
csharp dotnet performance
Last synced: 4 days ago
JSON representation
Span-ify your code: write high performance memory aware C#
- Host: GitHub
- URL: https://github.com/aelij/spanify
- Owner: aelij
- License: mit
- Created: 2023-05-31T06:14:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-31T08:35:37.000Z (9 months ago)
- Last Synced: 2024-10-04T11:59:04.086Z (about 1 month ago)
- Topics: csharp, dotnet, performance
- Language: C#
- Homepage:
- Size: 54.7 KB
- Stars: 66
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `Span`-ify your code
.NET has introduced low(er)-level memory management APIs over the years that can dramatically reduce the number of allocations and improve performance, and first among them is `Span`.
This repo demonstrates common usage patterns for some of those APIs.
> [!IMPORTANT]
> Always [benchmark](https://github.com/dotnet/BenchmarkDotNet) and test the code for correctness, especially when using low-level/unsafe APIs.## Table of contents
### [Basics](docs/basics.md)
Introduction to APIs and stack allocation
### [Strings](docs/strings.md)
Creating and manipulating strings
### [Parsing and formatting](docs/parsing-formatting.md)
Parsing and formatting values, by way of writing `JsonConverter`s
### [Buffers](docs/buffers.md)
Writing to buffers and streams
### [Collections](docs/collections.md)
Optimize access to collections
### [Console](docs/console.md)
Writing to the `Console` using UTF-8