Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/milandjurdjevic/strinum
Fast and easy conversion between enums and strings
https://github.com/milandjurdjevic/strinum
converter dotnet enum enumeration performance sourcegenerator string
Last synced: about 2 months ago
JSON representation
Fast and easy conversion between enums and strings
- Host: GitHub
- URL: https://github.com/milandjurdjevic/strinum
- Owner: milandjurdjevic
- License: mit
- Created: 2023-11-09T01:09:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-03T22:54:01.000Z (8 months ago)
- Last Synced: 2024-05-04T08:03:20.631Z (8 months ago)
- Topics: converter, dotnet, enum, enumeration, performance, sourcegenerator, string
- Language: C#
- Homepage:
- Size: 486 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Strinum [![latest version](https://img.shields.io/nuget/v/strinum)](https://www.nuget.org/packages/strinum)
### Fast and easy enum conversion to strings
Powerful source code generator designed to enhance your development workflow by automating the generation of
stringification methods for enum types. This "tool" efficiently scans your source code, identifies used enum types,
and generates methods that facilitate the conversion of enum members to their corresponding string
representations and vice versa.## Features
To read more about the library features and usage, please visit the [documentation](src/Strinum/README.md#features) link.## Benchmark
| Method | Mean | Error | StdDev | Gen0 | Allocated |
|---------------------|-----------:|----------:|----------:|-------:|----------:|
| Object_ToString | 10.4174 ns | 0.0292 ns | 0.0228 ns | 0.0038 | 24 B |
| Enum_GetName | 4.2885 ns | 0.0143 ns | 0.0112 ns | - | - |
| StringEnum_ToString | 0.5429 ns | 0.0209 ns | 0.0196 ns | - | - |### Legends
- Mean: Arithmetic mean of all measurements
- Error: Half of 99.9% confidence interval
- StdDev: Standard deviation of all measurements
- Gen0: GC Generation 0 collects per 1000 operations
- Allocated: Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)
- 1 ns: 1 Nanosecond (0.000000001 sec)### Device
- Chip: Apple M1 Pro
- Memory: 16 GB
- OS: Sonoma 14.1.2