Plumsail.CsvHelper.FastDynamic 1.0.0-ci8443164682

This is a prerelease version of Plumsail.CsvHelper.FastDynamic.
dotnet add package Plumsail.CsvHelper.FastDynamic --version 1.0.0-ci8443164682                
NuGet\Install-Package Plumsail.CsvHelper.FastDynamic -Version 1.0.0-ci8443164682                
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="Plumsail.CsvHelper.FastDynamic" Version="1.0.0-ci8443164682" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Plumsail.CsvHelper.FastDynamic --version 1.0.0-ci8443164682                
#r "nuget: Plumsail.CsvHelper.FastDynamic, 1.0.0-ci8443164682"                
#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.
// Install Plumsail.CsvHelper.FastDynamic as a Cake Addin
#addin nuget:?package=Plumsail.CsvHelper.FastDynamic&version=1.0.0-ci8443164682&prerelease

// Install Plumsail.CsvHelper.FastDynamic as a Cake Tool
#tool nuget:?package=Plumsail.CsvHelper.FastDynamic&version=1.0.0-ci8443164682&prerelease                

CsvHelper.FastDynamic

Build Downloads NuGet License

Fast dynamic CSV records reader and writer extensions for CsvHelper

Installation

Install-Package CsvHelper.FastDynamic
dotnet add package CsvHelper.FastDynamic

Usage

Simple CSV Reader

using CsvHelper;
using CsvHelper.FastDynamic;

using var csvReader = new CsvReader(new StreamReader("sample.csv"), CultureInfo.InvariantCulture);

var records = csvReader.GetDynamicRecords();

foreach (var @record in records)
{
    Console.WriteLine(record);
}

Async CSV Enumerate (.NET Standard 2.1 / C# 8.0 or later)

using CsvHelper;
using CsvHelper.FastDynamic;

using var csvReader = new CsvReader(new StreamReader("sample.csv"), CultureInfo.InvariantCulture);

var records = csvReader.EnumerateDynamicRecordsAsync();

await foreach (var @record in records)
{
    Console.WriteLine(record);
}

Performance

Dynamic records reader

BenchmarkDotNet v0.13.7, Windows 11 (10.0.22621.2361/22H2/2022Update/SunValley2)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK 7.0.401
  [Host]     : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
  DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2

|               Method |     Mean |   Error |  StdDev | Ratio |    Gen0 |    Gen1 | Allocated | Alloc Ratio |
|--------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
|           GetRecords | 679.9 μs | 2.30 μs | 2.04 μs |  1.00 | 31.2500 | 15.6250 | 510.87 KB |        1.00 |
| GetDictionaryRecords | 217.2 μs | 0.26 μs | 0.21 μs |  0.32 | 21.7285 | 21.4844 | 355.05 KB |        0.70 |
|    GetDynamicRecords | 159.6 μs | 1.12 μs | 1.04 μs |  0.23 | 14.4043 |  4.6387 | 237.29 KB |        0.46 |
|        GetRawRecords | 152.9 μs | 0.84 μs | 0.74 μs |  0.22 | 13.1836 |  5.1270 |    219 KB |        0.43 |

Dynamic records writer

BenchmarkDotNet v0.13.7, Windows 11 (10.0.22621.2361/22H2/2022Update/SunValley2)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK 7.0.401
  [Host]     : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
  DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2

|                            Method |     Mean |   Error |  StdDev | Ratio |    Gen0 |    Gen1 | Allocated | Alloc Ratio |
|---------------------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
|        WriteRecords_DynamicObject | 659.9 μs | 1.74 μs | 1.54 μs |  1.00 | 55.6641 | 12.6953 | 914.65 KB |        1.00 |
| WriteDynamicRecords_DynamicObject | 391.7 μs | 1.78 μs | 1.66 μs |  0.59 | 13.6719 |  2.9297 | 225.95 KB |        0.25 |

Thanks

License

This project is licensed under the Apache License 2.0

Product Compatible and additional computed target framework versions.
.NET 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-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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-ci8443164682 101 3/26/2024
1.0.0-ci20240326 59 3/26/2024