Coding Faster with dotNetTips.com Spargine 10: April 2026 Release

I am delighted to announce the release of Spargine 10 (v2026.10.4.1) on April 1st, 2026. Spargine, my open-source project, now offers NuGet packages for .NET 10. These enhancements have been integrated across all my projects. I encourage you to explore these updates and share any feedback or suggestions for further improvements.

This version supports .NET 10, introduces new types, methods, benchmarks, and comprehensive unit tests, all aimed at improving Spargine’s performance and reliability! Notably, this release includes speed enhancements informed by benchmark tests outlined in the 5th edition of Rock Your Code: Code & App Performance for Microsoft .NET, available on Amazon.

GitHub: https://github.com/RealDotNetDave/dotNetTips.Spargine.10/releases

NuGet: http://bit.ly/dotNetDaveNuGet

You can access all the performance data for these assemblies on GitHub. I continually seek assistance with these projects. If you are interested in contributing, please don’t hesitate to contact me via email at dotnetdave@live.com. Your support and collaboration are highly appreciated!

New Classes and Methods

Below are the new classes and methods added to this version of Spargine.

dotNetTips.Spargine.Core

TypeMethodDescription
AppClearAppState()Clears all entries from the application state dictionary.
AppRemoveAppState()Removes a value from the application state dictionary using the specified key.
ClockCurrentDayOfWeekGets the current day of the week (local time).
ClockCurrentDayOfYearGets the current day of the year (local time), from 1 to 366.
ClockCurrentQuarterGets the current quarter of the year (local time), from 1 to 4.
ClockCurrentUtcDayOfWeekGets the current day of the week (UTC).
ClockCurrentUtcQuarterGets the current quarter of the year (UTC), from 1 to 4.
ClockDaysInMonth()Gets the number of days in the specified month of the specified year.
ClockDaysRemainingInMonthGets the number of days remaining in the current month (local time).
ClockDaysRemainingInYearGets the number of days remaining in the current year (local time).
ClockFirstDayOfCurrentMonthGets the first day of the current month (local time).
ClockIsCurrentUtcYearLeapYearGets a value indicating whether the current UTC year is a leap year.
ClockIsCurrentYearLeapYearGets a value indicating whether the current local year is a leap year.
ClockIsWeekdayGets a value indicating whether today is a weekday (Monday through Friday) in local time.
ClockIsWeekendGets a value indicating whether today is a weekend (Saturday or Sunday) in local time.
ClockLastDayOfCurrentMonthGets the last day of the current month (local time).
ClockLocalUtcOffsetGets the local time zone’s current UTC offset.
ClockTodayGets midnight (start of day) for today in local time.
ClockTodayMidnightGets midnight (start of day) for today in local time.
ClockUnixTimestampGets the Unix timestamp (seconds since January 1, 1970 UTC).
ClockUnixTimestampMillisecondsGets the Unix timestamp in milliseconds (milliseconds since January 1, 1970 UTC).
ComputerInfoToJson() Converts the current instance of ComputerInfo to a JSON string.
ElapsedEventArgsElapsedGets the elapsed time reported by this event.
EncryptionHelperAesGcmEncrypt()Encrypts a string using AES-GCM (Galois/Counter Mode) authenticated encryption.
EnumerationTryFromDisplayName<T>()Attempts to retrieve an enumeration instance of type T that matches the specified display name.
EnumerationTryFromValue<T>()Attempts to retrieve an enumeration instance of type T that matches the specified integer value.
EnumHelperTryParse<T>()Attempts to parse the specified name into an enum value of type T.
NetworkHelperGetDnsServerAddresses()Gets the DNS server addresses configured for the active network interfaces.
NetworkHelperGetGatewayAddresses()Gets the gateway addresses configured for the active network interfaces.
NetworkHelperGetHostName()Gets the hostname of the local computer.
NetworkHelperGetLocalIPAddresses()Gets the local IP addresses for the computer.
NetworkHelperGetMacAddresses()Gets the MAC (physical) address of the active network interface.
NetworkHelperGetNetworkSpeeds()Gets the network speed (bandwidth) of active network interfaces in bits per second.
NetworkHelperGetNetworkStatistics()Gets network statistics for the specified network interface type.
NetworkHelperGetPrimaryNetworkInterface()Gets detailed information about the primary network interface.
NetworkHelperIsConnectedToEthernet()Checks if the computer is connected to an Ethernet network.
NetworkHelperIsConnectedToNetwork()Checks if the computer is connected to any network.
NetworkHelperIsConnectedToWiFi()Checks if the computer is connected to a Wi-Fi network.
NetworkHelperIsIPv6Supported()Checks if the specified network interface supports IPv6.
PerformanceStopwatchGetElapsedTime()Calculates the elapsed time since a starting high-resolution timestamp using the system performance counter.
PerformanceStopwatchGetTimeStamp()Gets the current high-resolution timestamp from the system’s performance counter.
SimpleResultAddMessage()Adds a message to the collection of messages associated with this result.

dotNetTips.Spargine.Extentions

TypeMethodDescription
CharacterExtensionsGetDigitValue()Gets the numeric value of the character if it is a digit (0-9).
CharacterExtensionsIsAsciiControlGets a value indicating whether the specified character is an ASCII control character (0-31 or 127).
CharacterExtensionsIsAsciiPunctuationGets a value indicating whether the specified character is an ASCII punctuation character.
CharacterExtensionsIsAsciiUpperGets a value indicating whether the specified character is an ASCII uppercase letter (A-Z).
CharacterExtensionsIsAsciiWhitespaceGets a value indicating whether the specified character is an ASCII whitespace character.
CharacterExtensionsIsHexDigitGets a value indicating whether the specified character is a valid hexadecimal digit (0-9, A-F, a-f).
CharacterExtensionsIsNewLineGets a value indicating whether the specified character is a newline character (CR or LF).
CharacterExtensionsIsUnicodeDigitGets a value indicating whether the specified character is a Unicode digit.
CharacterExtensionsToAsciiLower()Converts the character to lowercase using ASCII rules (fast path for a-z range).
CharacterExtensionsToAsciiUpper()Gets the uppercase equivalent of the character using ASCII rules (fast path for A-Z range).
EnumerableExtensionsFastContains()Performs a membership check using the most efficient strategy available for the underlying sequence.
EnumExtensionsFlagCountGets the count of flags set in a flag enum.
EnumExtensionsGetAttribute()Gets the custom attribute of type TAttributeapplied to the enum value.
EnumExtensionsGetDisplayName()Gets the display name from the DisplayAttribute if present; otherwise returns the enum’s name.
EnumExtensionsGetSetFlags()Gets the individual flag values that are set in a flag enum.
EnumExtensionsNext()Gets the next enum value in sequence, or the first value if at the end.
EnumExtensionsPrevious()Gets the previous enum value in sequence, or the last value if at the beginning.
EnumExtensionsToInt32()Gets the 32-bit integer value of the enum.
EnumExtensionsToInt64()Gets the 64-bit integer value of the enum.
ReadOnlyCollectionExtensionsGetValueOrDefault()Gets the element at the specified index, or the default value if the index is out of range.
ReadOnlyCollectionExtensionsTryGetValue()Attempts to get the element at the specified index.
SortedSetToImmutable()Converts a SortedSet to an ImmutableSortedSet.

dotNetTips.Spargine.Tester

TypeMethodDescription
UnitTesterCleanupOutputDirectory()Deletes all files matching the specified search pattern from the output directory.
UnitTesterMeasureAction() & MeasureActionAsync()Executes the specified action and returns the elapsed time, optionally printing the result to the debug output.
UnitTesterSaveAsJsonToFile()Serializes the specified object to JSON and saves it to a file in the output directory.
UnitTesterSaveToFileAsync()Asynchronously saves the specified input string to a file in the output directory.

Performance Enhancements: Significant Speed Improvements Across Methods

With every new release of Spargine, I continue to refine performance — and the .NET 10 version delivers substantial speed gains across many methods. Some improvements came because of careful tuning and benchmarking (sometimes with help from Copilot — with mixed results).

Here are the most notable speed increases:

  • App.ProcessPath(): 2x faster.
  • CollectionExtensions.AddRange(): 1.49x faster.
  • EnumerableExtensions.Create(): 86x faster with decreased allocations by 6x.
  • EnumerableExtensions.ToBlockingCollection(): 4.66x faster and decreased allocations by 3x.
  • ListExtensions.ToObservableCollection(): 28x faster and decreased allocations by 14x.
  • ListExtensions.ToReadOnlyObservableCollection(): 28x faster and decreased allocations by 10x.
  • LoggingHelper.LogApplicationInformation(): 775x faster.
  • PasswordGenerator.GeneratePassword(): 1.84x faster.
  • StringExtensions.CalculateTotalLength(): 3.3x faster with no allocations.
  • StringExtensions.HasValue() – String: 9.74x faster.
  • StringExtensions.HasValue() – using length: 1.64x faster.
  • StringExtensions.HasValue(): 2,535x faster.
  • StringExtensions.HasWhitespace(): 2.74x faster.
  • TypeHelper.GetAllGenericMethods(): 23.9x faster and decreased allocations by 15.8x.
  • TypeHelper.GetAllPublicMethods():  8.08x faster and decreased allocations by 15.13x.
  • TypeHelper.GetAllStaticMethods(): 16.28x faster and decreased allocations by 9.4x.
  • TypeHelper.GetAttribute() – FieldInfo: 2.6x faster.

Summary

I’m confident these new and enhanced Spargine features will significantly improve your projects by boosting both performance and reliability. Detailed benchmark results are available on GitHub for those who want to dig deeper.

As always, open-source thrives on community involvement. If you find these updates helpful — or have ideas for future improvements — I encourage you to jump in. Whether through pull requests, issue reports, or feature suggestions, your contributions are invaluable.

Together, we can continue to make Spargine a robust and indispensable tool for the .NET community. Your feedback is always welcome, so please share your thoughts in the comments.

If my work has helped you write faster, cleaner, rock-solid .NET code, I’d love your support through GitHub Sponsors. Your sponsorship helps fuel new features, benchmarks, tools, and learning resources for the entire community.

Join the crew here: https://github.com/sponsors/RealDotNetDave — and thanks for helping keep the code loud and fast!

Thank you for your support — and keep coding faster, smarter, and better!

Pick up any books by David McCarter by going to Amazon.com: http://bit.ly/RockYourCodeBooks

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

If you liked this article, please buy David a cup of Coffee by going here: https://www.buymeacoffee.com/dotnetdave

© The information in this article is copywritten and cannot be preproduced in any way without express permission from David McCarter.


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.