ParseZero 1.0.0

dotnet add package ParseZero --version 1.0.0
                    
NuGet\Install-Package ParseZero -Version 1.0.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="ParseZero" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ParseZero" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ParseZero" />
                    
Project file
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 ParseZero --version 1.0.0
                    
#r "nuget: ParseZero, 1.0.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 ParseZero@1.0.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=ParseZero&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ParseZero&version=1.0.0
                    
Install as a Cake Tool

ParseZero

The High-Performance Zero-Allocation CSV Parser for .NET

NuGet License: MIT

ParseZero is a specialized CSV parsing library focusing on zero allocation. It uses Span<T> and Memory<T> to read data without creating strings until absolutely necessary, keeping GC pressure near zero.

Features

  • 🚀 Zero Allocation - Uses Span<T>, Memory<T>, and ArrayPool<T> to minimize heap allocations
  • SIMD Acceleration - Hardware-accelerated delimiter scanning with AVX2/SSE2 on .NET 8+
  • 📊 IDataReader Support - Plug directly into SqlBulkCopy.WriteToServer() for blazing-fast database inserts
  • 🔄 Streaming - Process files of any size using System.IO.Pipelines
  • 🎯 Multi-Targeted - Supports both .NET 8+ and .NET Framework 4.7.2+ (via .NET Standard 2.0)
  • 🛡️ Robust - Handles quoted fields, escaped quotes, BOM, and mixed line endings

Installation

dotnet add package ParseZero

Quick Start

Basic Usage

using ParseZero;

// Simple row-by-row parsing
await foreach (var row in CsvReader.ReadAsync("data.csv"))
{
    int id = row[0].ParseInt32();
    string name = row[1].ToString();
    decimal price = row[2].ParseDecimal();
}

With Schema Mapping

using ParseZero;
using ParseZero.Schema;

public record Trade(int Id, string Symbol, decimal Price, DateTime Timestamp);

var schema = Schema.For<Trade>()
    .Column(t => t.Id)
    .Column(t => t.Symbol)
    .Column(t => t.Price, format: "C2")
    .Column(t => t.Timestamp, format: "yyyy-MM-dd HH:mm:ss");

await foreach (var trade in CsvReader.ReadAsync<Trade>("trades.csv", schema))
{
    Console.WriteLine($"{trade.Symbol}: {trade.Price}");
}

SqlBulkCopy Integration

using ParseZero;
using ParseZero.Data;
using Microsoft.Data.SqlClient;

await using var connection = new SqlConnection(connectionString);
await connection.OpenAsync();

await using var reader = CsvDataReader.Create("large-dataset.csv", options);

using var bulkCopy = new SqlBulkCopy(connection);
bulkCopy.DestinationTableName = "Trades";
await bulkCopy.WriteToServerAsync(reader);

Configuration Options

var options = new CsvOptions
{
    Delimiter = ',',
    HasHeader = true,
    Encoding = Encoding.UTF8,
    BufferSize = 4096,
    MaxLineLength = 64 * 1024,  // DoS protection
    TrimFields = true,
    AllowQuotedFields = true
};

await foreach (var row in CsvReader.ReadAsync("data.csv", options))
{
    // Process rows
}

Performance

ParseZero achieves zero allocation by:

  1. Buffer Pooling - Reuses byte arrays from ArrayPool<T>
  2. Span Slicing - Returns ReadOnlySpan<char> slices instead of allocating strings
  3. SIMD Scanning - Uses AVX2/SSE2 to scan 32 bytes at a time for delimiters
  4. Pipelines - Streams data through System.IO.Pipelines for optimal I/O

Benchmark Results

Parsing 100,000 rows (10 columns each) on .NET 8.0 with AVX2:

Method Mean Allocated Alloc Ratio
ParseZero (ForEach) 22.1 ms 2.9 MB 0.27x
ParseZero (File) 23.1 ms 2.9 MB 0.27x
Sylvan.Data.Csv (File) 25.8 ms 4.3 MB 0.42x
Sylvan.Data.Csv (Stream) 38.6 ms 15.4 MB 1.51x
ParseZero (Stream) 67.4 ms 10.2 MB 1.00x (baseline)

Key takeaways:

  • ParseZero's file-based parsing is 10% faster than Sylvan with 33% less memory
  • The FieldCountOnly mode achieves near-zero allocation (280 bytes for 100K rows)
  • SIMD-accelerated delimiter scanning on .NET 8+ provides additional throughput

Benchmark: BenchmarkDotNet, Intel Core i7-10870H, .NET 8.0, Release build

Supported Encodings

  • UTF-8 (with and without BOM)
  • UTF-16 LE/BE (with BOM detection)
  • ISO-8859-1 (Latin-1)
  • Windows-1252

Target Frameworks

Framework SIMD Support
.NET 8.0+ ✅ AVX2/SSE2
.NET Standard 2.0 ❌ Scalar only
.NET Framework 4.7.2+ ❌ Scalar only

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 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. 
.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 was computed. 
.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. 
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 98 1/19/2026