You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the repository for the ['KZDev.PerfUtils'](https://www.nuget.org/packages/KZDev.PerfUtils) nuget package that contains the `MemoryStreamSlim` class; a high-performance, memory-efficient, and easy-to-use replacement for the `MemoryStream` class that provides particular benefits for large or frequently used streams.
3
+
This is the repository for the ['KZDev.PerfUtils'](https://www.nuget.org/packages/KZDev.PerfUtils) nuget package that contains the `MemoryStreamSlim` class; a high-performance, memory-efficient, and easy-to-use replacement for the `MemoryStream` class that provides particular benefits for large or frequently used streams. As well as the `StringBuilderCache` which allows better performance when using `StringBuilder` instances, and the `InterlockedOps` class, which provides additional atomic thread-safe operations to extend the functionality of the `Interlocked` class in the .NET Class Library.
4
4
5
5
## Features
6
6
@@ -12,19 +12,38 @@ This is the repository for the ['KZDev.PerfUtils'](https://www.nuget.org/package
12
12
* Simple replacement for `MemoryStream` with the same API, other than the constructor.
13
13
* Optionally allows using native memory for storage, which allows even more flexibility to minimize GC pressure.
14
14
15
-
## Future Features
15
+
`StringBuilderCache` is a static class that provides a thread-safe cache of `StringBuilder` instances to reduce the number of allocations and deallocations of `StringBuilder` objects in high-throughput scenarios with simple operations:
16
+
17
+
* Acquire : Get a `StringBuilder` instance from the cache.
18
+
* Release : Return a `StringBuilder` instance to the cache.
19
+
* GetStringAndRelease : Get the string from a `StringBuilder` instance and return it to the cache.
20
+
* GetScope : Get a `using` scoped `StringBuilder` instance from the cache and return it to the cache when the scope is exited.
21
+
* Monitoring with `Events` feature of the .NET runtime for detailed cache management.
22
+
23
+
`InterlockedOps` is a static class providing the following thread-safe atomic operations:
16
24
17
-
The roadmap plan for this package is to add several additional helpful performance focused utilities. These will be forthcoming as time permits, so this first release is focused just on the `MemoryStreamSlim` class.
25
+
* Xor : Exclusive OR operation on any integer types.
26
+
* ClearBits : Clear bits on any integer types.
27
+
* SetBits : Set bits on any integer types.
28
+
* ConditionAnd : Conditionally update bits using an AND operation on any integer types.
29
+
* ConditionOr : Conditionally update bits using an OR operation on any integer types.
30
+
* ConditionXor : Conditionally update bits using an XOR operation on any integer types.
31
+
* ConditionClearBits : Conditionally clear bits on any integer types.
32
+
* ConditionSetBits : Conditionally set bits on any integer types.
18
33
19
34
## Documentation
20
35
21
36
Full documentation for the package is available on the [PerfUtils Documentation](https://kzdev-net.github.io/kzdev.perfutils/) page.
22
37
38
+
## Future Features
39
+
40
+
The roadmap plan for this package is to add several additional helpful performance focused utilities as time allows.
41
+
23
42
## Contribution Guidelines
24
43
25
44
At this time, I am not accepting external pull requests. However, any feedback or suggestions are welcome and can be provided through the following channels:
26
45
27
-
-**Feature Requests:** Please use GitHub Discussions to discuss new new features or enhancements before opening a feature request. This will help ensure that your request is in line with the project's goals and vision.
46
+
-**Feature Requests:** Please use GitHub Discussions to discuss new features or enhancements before opening a feature request. This will help ensure that your request is in line with the project's goals and vision.
28
47
-**Bug Reports:** If you encounter any issues, feel free to open an issue so it can be addressed promptly.
29
48
30
49
I appreciate your understanding and look forward to collaborating with you through discussions and issue tracking.
0 commit comments