Skip to content

Commit 1f6165e

Browse files
committed
Update some misc. package information and documentation files.
Add benchmarks, update docs, and extend copyright Updated toc.yml to include new benchmark sections and results. Modified solution file to include new markdown files. Extended copyright year to 2025 in Directory.Build.props. Updated csproj with new StringBuilderCache class details. Enhanced nuget.readme.md with StringBuilderCache info. Added StringBuilderCache methods and .NET Events monitoring.
1 parent c0f855a commit 1f6165e

5 files changed

Lines changed: 35 additions & 4 deletions

File tree

Source/Docs/articles/toc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
href: stringbuildercache-monitoring.md
1010
- name: Benchmarks
1111
href: stringbuildercache-benchmarks.md
12+
items:
13+
- name: Single Thread Benchmarks
14+
href: wrapper-throughput-benchmarks.md
15+
items:
16+
- name: Benchmark Results
17+
href: StringsBenchmarks.StringBuilderThroughputBenchmarks-report-github.md
18+
- name: Benchmark Results (Full HTML Table)
19+
href: StringsBenchmarks.StringBuilderThroughputBenchmarks-report.html
20+
- name: Multiple Thread Benchmarks
21+
href: continuous-growth-throughput-benchmarks.md
22+
items:
23+
- name: Benchmark Results
24+
href: StringsBenchmarks.StringBuilderMultipleThreadThroughputBenchmarks-report-github.md
25+
- name: Benchmark Results (Full HTML Table)
26+
href: StringsBenchmarks.StringBuilderMultipleThreadThroughputBenchmarks-report.html
1227
- name: Memory Stream
1328
href: memorystreamslim.md
1429
items:

Source/KZDev.PerfUtils.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Articles", "Articles", "{B9
9999
Docs\articles\stringbuildercache-multithread-throughput-benchmarks.md = Docs\articles\stringbuildercache-multithread-throughput-benchmarks.md
100100
Docs\articles\stringbuildercache-throughput-benchmarks.md = Docs\articles\stringbuildercache-throughput-benchmarks.md
101101
Docs\articles\stringbuildercache.md = Docs\articles\stringbuildercache.md
102+
Docs\articles\StringsBenchmarks.StringBuilderMultipleThreadThroughputBenchmarks-report-github.md = Docs\articles\StringsBenchmarks.StringBuilderMultipleThreadThroughputBenchmarks-report-github.md
103+
Docs\articles\StringsBenchmarks.StringBuilderMultipleThreadThroughputBenchmarks-report.html = Docs\articles\StringsBenchmarks.StringBuilderMultipleThreadThroughputBenchmarks-report.html
104+
Docs\articles\StringsBenchmarks.StringBuilderThroughputBenchmarks-report-github.md = Docs\articles\StringsBenchmarks.StringBuilderThroughputBenchmarks-report-github.md
105+
Docs\articles\StringsBenchmarks.StringBuilderThroughputBenchmarks-report.html = Docs\articles\StringsBenchmarks.StringBuilderThroughputBenchmarks-report.html
102106
Docs\articles\toc.yml = Docs\articles\toc.yml
103107
Docs\articles\wrapper-throughput-benchmarks.md = Docs\articles\wrapper-throughput-benchmarks.md
104108
EndProjectSection

Source/Src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
1212
<Version>1.2.0</Version>
1313
<Authors>Kevin Zehrer</Authors>
14-
<Copyright>Copyright © 2024 Kevin Zehrer. All rights reserved.</Copyright>
14+
<Copyright>Copyright © 2024-2025 Kevin Zehrer. All rights reserved.</Copyright>
1515
<Product>KZDev Performance Utilities</Product>
1616
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1717
</PropertyGroup>

Source/Src/KZDev.PerfUtils/KZDev.PerfUtils.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<PackageReadmeFile>docs\README.md</PackageReadmeFile>
1212
<PackageIcon>images\icon.png</PackageIcon>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
14-
<PackageDescription>Performance utilities for .NET projects, including the 'MemoryStreamSlim' class; a high-performance, memory-efficient, and easy-to-use replacement for 'MemoryStream', and the 'InterlockedOps' class which has additional thread-safe atomic operations beyond those provided by the 'Interlocked' class.</PackageDescription>
15-
<PackageReleaseNotes>Further MemoryStreamSlim performance enhancements and added InterlockedOps class (version 1.1.0).</PackageReleaseNotes>
14+
<PackageDescription>Performance utilities for .NET projects, including the 'MemoryStreamSlim', 'StringBuilderCache', and 'InterlockedOps' classes.</PackageDescription>
15+
<PackageReleaseNotes>MemoryStreamSlim idle memory trimming and added StringBuilder class (version 1.2.0).</PackageReleaseNotes>
1616
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1717
<RepositoryUrl>https://github.com/kzdev-net/kzdev.perfutils</RepositoryUrl>
1818
</PropertyGroup>

Source/Src/KZDev.PerfUtils/Package/nuget.readme.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# KZDev.PerfUtils
22

3-
This package contains the `MemoryStreamSlim` class; a high-performance, memory-efficient, and easy-to-use replacement for the `MemoryStream` class that provides particular performance benefits for large or frequently used streams. The package also contains the `InterlockedOps` class, which provides additional atomic thread-safe operations to extend the functionality of the `Interlocked` class in the .NET Class Library.
3+
The `KZDev.PerfUtils` package contains the following performance utility classes:
4+
5+
- `MemoryStreamSlim` - a high-performance, memory-efficient, easy-to-use replacement for the `MemoryStream` class that provides particular performance benefits for large or frequently used streams.
6+
- `StringBuilderCache` - a thread-safe cache of `StringBuilder` instances to improve speed and reduce the overhead of memory allocations associated with using the `StringBuilder` class.
7+
- `InterlockedOps` - which provides additional atomic thread-safe operations to extend the functionality of the `Interlocked` class in the .NET Class Library.
48

59
## Features
610

@@ -12,6 +16,14 @@ This package contains the `MemoryStreamSlim` class; a high-performance, memory-e
1216
* Simple replacement for `MemoryStream` with the same API, other than the constructor.
1317
* Optionally allows using native memory for storage, which allows even more flexibility to minimize GC pressure.
1418

19+
`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:
20+
21+
* Acquire : Get a `StringBuilder` instance from the cache.
22+
* Release : Return a `StringBuilder` instance to the cache.
23+
* GetStringAndRelease : Get the string from a `StringBuilder` instance and return it to the cache.
24+
* GetScope : Get a `using` scoped `StringBuilder` instance from the cache and return it to the cache when the scope is exited.
25+
* Monitoring with `Events` feature of the .NET runtime for detailed cache management.
26+
1527
`InterlockedOps` is a static class providing the following thread-safe atomic operations:
1628

1729
* Xor : Exclusive OR operation on any integer types.

0 commit comments

Comments
 (0)