|
1 | 1 | # Sharpify |
2 | 2 |
|
3 | | -A collection of high performance language extensions for C#, fully compatible with NativeAOT |
4 | | - |
5 | | -## ⬇ Installation |
6 | | - |
7 | | -[](https://www.nuget.org/packages/Sharpify/) |
8 | | -> dotnet add package Sharpify |
9 | | -
|
10 | | -[](https://www.nuget.org/packages/Sharpify.Data/) |
11 | | -> dotnet add package Sharpify.Data |
12 | | -
|
13 | | -* `Sharpify.Data` is deprecated and will no longer be maintained. Refer to [ArrowDb](https://github.com/dusrdev/ArrowDb) for a superior alternative. |
14 | | - |
15 | | -[](https://www.nuget.org/packages/Sharpify.CommandLineInterface/) |
16 | | -> dotnet add package Sharpify.CommandLineInterface |
| 3 | +[](https://www.nuget.org/packages/Sharpify) |
| 4 | +[](https://www.nuget.org/packages/Sharpify) |
| 5 | +[](License.txt) |
| 6 | +[](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) |
17 | 7 |
|
18 | | -## Sharpify - Base package |
19 | | - |
20 | | -`Sharpify` is a package mainly intended to extend the core language using high performance implementations. The other 2 packages uses `Sharpify` as a dependency. But its core features can be useful in a variety of applications by themselves. |
| 8 | +A collection of high performance language extensions for C#, fully compatible with NativeAOT |
21 | 9 |
|
22 | 10 | * ⚡ Fully Native AOT compatible |
23 | 11 | * 🤷 `Either<T0, T1>` - Discriminated union object that forces handling of both cases |
24 | 12 | * 🦾 Flexible `Result` type that can encapsulate any other type and adds a massage options and a success or failure status. Flexible as it doesn't require any special handling to use (unlike `Either`) |
25 | | -* 🏄 Wrapper extensions that simplify use of common functions and advanced features from the `CollectionsMarshal` class |
26 | 13 | * `Routine` and `AsyncRoutine` bring the user easily usable and configurable interval based background job execution. |
27 | | -* `PersistentDictionary` and derived types are super lightweight and efficient serializable dictionaries that are thread-safe and work amazingly for things like configuration files. |
28 | 14 | * `SortedList<T>` bridges the performance of `List` and order assurance of `SortedSet` |
29 | | -* `PersistentDictionary` and variants provide all simple database needs, with perfected performance and optimized concurrency. |
30 | | -* `SerializableObject` and the `Monitored` variant allow persisting an object to the disk, and elegantly synchronizing modifications. |
| 15 | +* `Synchronized<T>` is a thread-safe object owner with an optional delegate that can be executed on update. |
31 | 16 | * 💿 `StringBuffer` enables zero allocation, easy to use appending buffer for creation of strings in hot paths. |
32 | | -* `RentedBufferWriter{T}` is an allocation friendly alternative to `ArrayBufferWriter{T}` for hot paths. |
| 17 | +* `PooledArrayOwner{T}` is struct based alternative to `IMemoryOwner<T>` with extensions built into the `ArrayPool<T>` class. |
| 18 | +* `BufferWrapper{T}` is a ref struct implementation of `IBufferWriter{T}` that wraps a `Span<T>`. |
33 | 19 | * A 🚣🏻 boat load of extension functions for all common types, bridging ease of use and performance. |
34 | | -* `Utils.DateAndTime`, `Utils.Env`, `Utils.Math`, `Utils.Strings` and `Utils.Unsafe` provide uncanny convenience at maximal performance. |
35 | | -* 🧵 `ThreadSafe<T>` makes any variable type thread-safe |
| 20 | +* A bunch of utils in `Utils` class. |
36 | 21 | * 🔐 `AesProvider` provides access to industry leading AES-128 encryption with virtually no setup |
37 | 22 | * 🏋️ High performance optimized alternatives to core language extensions |
38 | | -* 🎁 More added features that are not present in the core language |
39 | | -* ❗ Static inner exception throwers guide the JIT to further optimize the code during runtime. |
40 | 23 | * 🫴 Focus on giving the user complete control by using flexible and common types, and resulting types that can be further used and just viewed. |
41 | 24 |
|
42 | | -For more information check [inner directory](src/Sharpify/README.md). |
43 | | - |
44 | | -## Sharpify.Data |
45 | | - |
46 | | -`Sharpify.Data` is an extension package, that should be installed on-top of `Sharpify` and adds a high performance persistent key-value-pair database, utilizing [MemoryPack](https://github.com/Cysharp/MemoryPack). The database support multiple types in the same file, 2 stage AES encryption (for whole file and per-key). Filtering by type, Single or Array value per key, and more... |
47 | | - |
48 | | -* `Database` is the base type for the data base, it is key-value-pair based local database - saved on disk. |
49 | | -* `IDatabaseFilter<T>` is an interface which acts as an alternative to `DbContext` and provides enhanced type safety for contexts. |
50 | | -* `MemoryPackDatabaseFilter<T>` is an implementation which focuses on types that implement `IMemoryPackable<T>` from `MemoryPack`. |
51 | | -* `FlexibleDatabaseFilter<T>` is an implementation focusing on types which need custom serialization logic. To use this, you type `T` will need to implement `IFilterable<T>` which has methods for serialization and deserialization of single `T` and `T[]`. If you can choose to implement only one of the two. |
52 | | -* **Concurrency** - `Database` uses highly performant synchronous concurrency models and is completely thread-safe. |
53 | | -* **Disk Usage** - `Database` tracks inner changes and skips serialization if no changes occurred, enabling usage of periodic serialization without resource waste. |
54 | | -* **GC Optimization** - `Database` heavily uses pooling for encryption, decryption, type conversion, serialization and deserialization to minimize GC overhead, very rarely does it allocate single-use memory and only when absolutely necessary. |
55 | | -* **HotPath APIs** - `Database` is optimized for hot paths, as such it provides a number of APIs that specifically combine features for maximum performance and minimal GC overhead. Like the `TryReadToRentedBuffer<T>` methods which is optimized for adding data to a table. |
56 | | -* **Runtime Optimization** - Upon initialization, `Database` chooses specific serializers and deserializers tailored for specific configurations, minimizing the amount of runnable code during runtime that would've been wasted on different checks. |
| 25 | +## ⬇ Installation |
57 | 26 |
|
58 | | -For more information check [inner directory](src/Sharpify.Data/README.md). |
| 27 | +> dotnet add package Sharpify |
59 | 28 |
|
60 | 29 | ## Sharpify.CommandLineInterface |
61 | 30 |
|
62 | 31 | `Sharpify.CommandLineInterface` is a standalone package that adds a high performance, reflection free and `AOT-ready` framework for creating command line and embedded interfaces |
63 | 32 |
|
64 | | -* Maintenance friendly model that depends on classes that implement `Command` or `SynchronousCommand` |
65 | | -* `Arguments` is an abstraction layer over the inputs that validate during runtime according to user needs via convenient APIs. |
66 | | -* Configuration using a fluent builder pattern. |
67 | | -* Configurable output and input pipes, enable usage outside of `Console` apps, supporting embedded use in any application. |
68 | | -* Automatic and structured general and command-specific help text. |
69 | | -* Configurable error handling with defaults. |
70 | | -* Super lightweight |
| 33 | +It was moved to its own repo [Sharpify.CommandLineInterface](https://github.com/dusrdev/Sharpify.CommandLineInterface) |
71 | 34 |
|
72 | | -For more information check [inner directory](src/Sharpify.CommandLineInterface/README.md) |
| 35 | +## |
73 | 36 |
|
74 | 37 | ## Methodology |
75 | 38 |
|
|
0 commit comments