Sharpify 2.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sharpify --version 2.4.0
NuGet\Install-Package Sharpify -Version 2.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sharpify" Version="2.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sharpify" Version="2.4.0" />
<PackageReference Include="Sharpify" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sharpify --version 2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sharpify, 2.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sharpify@2.4.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sharpify&version=2.4.0
#tool nuget:?package=Sharpify&version=2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CHANGELOG
v2.4.0
- All derived types of
PersistentDictionarynow implementIDisposableinterface. - Main concurrent processing methods are now
ICollection<T>.ForAll()andICollection<T>.ForAllAsync()from many, many benchmarks it became clear that for short duration tasks not involving heavy compute, it has by far the best compromise of speed and memory-allocation. If you use it with a nonasync functionall the tasks will yield immediately and require virtually no allocations at all. Which is as good asValueTaskfrom benchmarks. This method has 2 overloads, one which accepts anIAsyncActionwhich enables users with long code and many captured variables to maintain a better structured codebase, and aFuncalternative for quick and easy usage. The difference in memory allocation / execution time between time is nearly non-existent, this mainly for maintainability. - For heavier compute tasks, please revert to using
Parallel.FororParallel.ForEachAsyncand their overloads, they are excellent in load balancing. - Due to the changes above, all other concurrent processing methods, such as
ForEachAsync,InvokeAsyncand all the related functionality from theConcurrentclass have been removed.AsAsyncLocalentry is also removed, and users will be able to access the newForAllandForAllAsyncmethods directly from theICollection<T>interface static extensions. ForAllandForAllAsyncmethods have identical parameters, the only difference is that the implementation forForAllis optimized for synchronous lambdas that don't need to allocate an AsyncStateMachine, while theForAllAsyncis optimized for increased concurrency for asynchronous lambdas. ChoosingForAllfor synchronous lambdas massively decreases memory allocation and execution time.IAsyncAction<T>'sInvokeAsyncmethod now has aCancellationTokenparameter.- Changes to
TimeSpanrelated functions:Format,FormatNonAllocated,ToRemainingDuration,ToRemainingDurationNonAllocated,ToTimeStamp,ToTimeStampNonAllocated, were all removed due to duplication and suboptimal implementations.- The new methods replacing these functionalities are now in
Utils.DateAndTimenamespace. FormatTimeSpanis now replacingFormatandFormatNonAllocated,FormatTimeSpanis hyper optimized. The first overload requires aSpan{char}buffer of at least 30 characters, and returns aReadOnlySpan{char}of the written portion. The second doesn't require a buffer, and allocated a newstringwhich is returned.FormatTimeSpanoutputs a different format than the predecessor, as the time was formatted in decimal and is rather confusing, now it is formatted as00:00unitfor the largest 2 units. So a minute and a half would be01:30mand a day and a half would be02:30detc... this seems more intuitive to me.FormatTimeStampis now replacingToTimeStampandToTimeStampNonAllocated, it is also optimized and the overloads work the same way asFormatTimeSpan.
- The
StringBufferwhich previously rented arrays from the shared array pool, then used the same API's to write to it asAllocatedStringBufferwas removed. The previousAllocatedStringBufferwas now renamed toStringBufferand it requires a pre-allocatedSpan{char}. You can get the same functionality by renting any buffer, and simply supplying toStringBuffer.Create. This allowed removal of a lot of duplicated code and made the API more consistent.StringBuffernow doesn't have an implicit converter toReadOnlySpan{char}anymore, useStringBuffer.WrittenSpaninstead. IModifier{T}was removed, useFunc<T, T>instead.Utils.Strings.FormatByteswas changed in the same manner asUtils.DateAndTime.FormatTimeSpanandUtils.DateAndTime.FormatTimeStamp, it now returns aReadOnlySpan<char>instead of astringand it is optimized to use less memory.ThreadSafe<T>now implementsIEquatable<T>andIEquatable<ThreadSafe<T>>to allow comparisons.
Upon the release of .NET 9, another version will be released utilizing certain optimizations specifically for .NET 9, but the feature set should be the same.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Sharpify:
| Package | Downloads |
|---|---|
|
Sharpify.Data
An extension of Sharpify, focused on Data |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.1 | 708 | 11/18/2025 |
| 2.5.0 | 1,181 | 11/13/2024 |
| 2.4.0 | 4,087 | 10/21/2024 |
| 2.4.0-alpha | 289 | 10/8/2024 |
| 2.2.0 | 702 | 7/26/2024 |
| 2.1.0 | 221 | 7/18/2024 |
| 2.0.0 | 354 | 6/3/2024 |
| 1.8.1 | 271 | 5/30/2024 |
| 1.8.0 | 247 | 4/17/2024 |
| 1.7.3 | 356 | 1/29/2024 |
| 1.7.2 | 230 | 1/23/2024 |
| 1.7.1 | 456 | 1/20/2024 |
| 1.7.0 | 218 | 1/20/2024 |
| 1.6.0 | 254 | 1/15/2024 |
| 1.5.0 | 284 | 1/10/2024 |
| 1.4.2 | 237 | 1/8/2024 |
| 1.4.1 | 320 | 1/4/2024 |
| 1.4.0 | 280 | 1/4/2024 |
| 1.3.1 | 252 | 12/31/2023 |
Loading failed