Sylvan.Common
0.4.3
dotnet add package Sylvan.Common --version 0.4.3
NuGet\Install-Package Sylvan.Common -Version 0.4.3
<PackageReference Include="Sylvan.Common" Version="0.4.3" />
paket add Sylvan.Common --version 0.4.3
#r "nuget: Sylvan.Common, 0.4.3"
// Install Sylvan.Common as a Cake Addin
#addin nuget:?package=Sylvan.Common&version=0.4.3
// Install Sylvan.Common as a Cake Tool
#tool nuget:?package=Sylvan.Common&version=0.4.3
Sylvan.Common
The Sylvan.Common
library contains a collection of types and extensions that I've developed over time.
Most of these will not be of much interest to most people, but you're free to use it if you do.
IsoDate
Exposes methods to convert to and from ISO 8601 formatted dates.
These are faster than the default DateTime implementation since they don't need to account for a variety of formats and cultures.
DateTime.TryParse
performance is best when using the "O" (round-trip) format specifier, which requires a very specific ISO 8601 format.
IsoDate
attempts to be a bit more lenient in what it parses, while maintaining high performance.
This code was largely taken from an implementation in System.Text.Json
, which I then modified in the following way:
- Handles chars instead of bytes, as the S.T.Json impl was utf-8 specific.
- Allows ' ' in place of 'T' as time separator. Not ISO compliant, but common enough that I wanted to support it.
- Allows ',' in place of '.' as fractional time separator, which ISO8601 apparently allows, but isn't supported by S.T.Json.
- Rounds appropriately when more than 7 fractional second digits are parsed. Nanoseconds are important, right.
StringPool
This type provides a means of de-duping strings upon construction.
It is conceptually similar to the System.Xml.NameTable
type, which is intended to de-dupe the repetitive names in XML.
This implements a dictionary that only allows adding by calling string GetString(char[] buffer, int offset, int length)
, which
will return an existing string if the same sequence has already been seen. This was created to de-dupe strings in
the Sylvan.Data.Csv.CsvDataReader
implementation. This type has no eviction policy, so it is essentially a giant memory
leak until it is GCed.
If you are intending to use this along with the Sylvan CSV reader, you might investigate using
Ben.StringPool instead, which offers a more
robust implementation that includes LRU cache eviction, making it suitable for use in longer-lived scopes.
PooledMemoryStream
Implements an in-memory buffer, similar to MemoryStream, but instead maintaining a contiguous block of memory, uses a series of fixed-size pages to hold data. Pages are allocated from an ArrayPool. This is intended for specific high-performance scenarios, where it can offer better performance than MemoryStream.
StringBuffer
Implements a TextWriter that uses the same pattern as the PooledMemoryStream.
... and more
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Buffers (>= 4.4.0)
- System.Memory (>= 4.5.0)
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Sylvan.Common:
Package | Downloads |
---|---|
Sylvan.AspNetCore.Mvc.Csv
Package Description |
|
Sylvan.AspNetCore.Mvc.Excel
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Sylvan.Common:
Repository | Stars |
---|---|
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
|
|
nietras/Sep
Modern, minimal, fast, zero allocation, reading and writing of separated values (`csv`, `tsv` etc.). Cross-platform, trimmable and AOT/NativeAOT compatible.
|
Version | Downloads | Last updated |
---|---|---|
0.4.3 | 651 | 11/2/2023 |
0.4.2 | 20,869 | 4/25/2023 |
0.4.1 | 29,538 | 12/29/2022 |
0.3.0 | 38,197 | 10/30/2021 |
0.2.1 | 1,612 | 1/26/2021 |
0.2.0 | 535 | 9/10/2020 |
0.1.7 | 415 | 5/19/2020 |
0.1.6 | 412 | 5/19/2020 |
0.1.5 | 408 | 5/19/2020 |
0.1.4 | 394 | 5/11/2020 |
0.1.3 | 428 | 4/10/2020 |
0.1.2 | 394 | 4/4/2020 |
0.1.1 | 476 | 4/4/2020 |
0.1.0 | 435 | 12/23/2019 |