ParseZero 1.0.0
dotnet add package ParseZero --version 1.0.0
NuGet\Install-Package ParseZero -Version 1.0.0
<PackageReference Include="ParseZero" Version="1.0.0" />
<PackageVersion Include="ParseZero" Version="1.0.0" />
<PackageReference Include="ParseZero" />
paket add ParseZero --version 1.0.0
#r "nuget: ParseZero, 1.0.0"
#:package ParseZero@1.0.0
#addin nuget:?package=ParseZero&version=1.0.0
#tool nuget:?package=ParseZero&version=1.0.0
ParseZero
The High-Performance Zero-Allocation CSV Parser for .NET
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>, andArrayPool<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:
- Buffer Pooling - Reuses byte arrays from
ArrayPool<T> - Span Slicing - Returns
ReadOnlySpan<char>slices instead of allocating strings - SIMD Scanning - Uses AVX2/SSE2 to scan 32 bytes at a time for delimiters
- Pipelines - Streams data through
System.IO.Pipelinesfor 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
FieldCountOnlymode 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 | Versions 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. |
-
.NETStandard 2.0
- System.Buffers (>= 4.5.1)
- System.IO.Pipelines (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
-
net8.0
- System.IO.Pipelines (>= 8.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
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 |