From 4129489039a93aefb164500a65884dd5235d3246 Mon Sep 17 00:00:00 2001 From: Julius Park Date: Mon, 16 Mar 2026 21:19:27 -0400 Subject: [PATCH 1/2] initial commit --- Cargo.lock | 6 ++++++ Cargo.toml | 1 + examples/count.rs | 15 +++++++++++++++ scripts/bench.sh | 3 ++- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 764ca32..bcbe6ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,6 +115,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "csimdv" +version = "0.1.0" +source = "git+https://github.com/juliusgeo/csimdv-rs.git#84f8dc7f5469d304dbd5d80d16d76d46bb61cdc3" + [[package]] name = "csv" version = "1.3.1" @@ -247,6 +252,7 @@ dependencies = [ "anyhow", "bstr", "clap", + "csimdv", "csv", "memchr", "memmap2", diff --git a/Cargo.toml b/Cargo.toml index 93296aa..0913c32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,3 +37,4 @@ bstr = "1.12.0" clap = { version = "4.5.47", features = ["derive"] } csv = "1.3.1" memmap2 = "0.9.8" +csimdv = { git = "https://github.com/juliusgeo/csimdv-rs.git" } diff --git a/examples/count.rs b/examples/count.rs index b930ae1..e64920d 100644 --- a/examples/count.rs +++ b/examples/count.rs @@ -13,6 +13,7 @@ enum CountingMode { Copy, MmapCopy, Lines, + CSimdV } #[derive(Parser, Debug)] @@ -175,6 +176,20 @@ fn main() -> anyhow::Result<()> { println!("{}", reader.count_lines()?); } + CountingMode::CSimdV => { + use csimdv::{default_dialect, Parser}; + use csimdv::aligned_buffer::AlignedBuffer; + let file = File::open(&args.path)?; + let mut p = Parser::new(default_dialect(), AlignedBuffer::new(file)); + let mut count = 0; + while let Some(mut record) = p.read_line() { + for field in record.iter() { + let _ = field.len(); + } + count += 1; + } + println!("{}", count); + } } Ok(()) diff --git a/scripts/bench.sh b/scripts/bench.sh index a40d8a0..e8b870f 100755 --- a/scripts/bench.sh +++ b/scripts/bench.sh @@ -30,7 +30,8 @@ do "$PROG baseline $path" \ "$PROG simd $path" \ "$PROG zero-copy $path" \ - "$PROG copy $path" + "$PROG copy $path" \ + "$PROG c-simd-v $path" printf %"$(tput cols)"s | tr " " "-" echo From 74bb520e09153d842d57f0e7c34e5b414a5a102c Mon Sep 17 00:00:00 2001 From: Julius Park Date: Wed, 18 Mar 2026 17:53:20 -0400 Subject: [PATCH 2/2] fix benchmark --- examples/count.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/count.rs b/examples/count.rs index e64920d..29e6319 100644 --- a/examples/count.rs +++ b/examples/count.rs @@ -182,10 +182,7 @@ fn main() -> anyhow::Result<()> { let file = File::open(&args.path)?; let mut p = Parser::new(default_dialect(), AlignedBuffer::new(file)); let mut count = 0; - while let Some(mut record) = p.read_line() { - for field in record.iter() { - let _ = field.len(); - } + while let Some(_) = p.read_line() { count += 1; } println!("{}", count);