Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
12 changes: 12 additions & 0 deletions examples/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum CountingMode {
Copy,
MmapCopy,
Lines,
CSimdV
}

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -175,6 +176,17 @@ 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(_) = p.read_line() {
count += 1;
}
println!("{}", count);
}
}

Ok(())
Expand Down
3 changes: 2 additions & 1 deletion scripts/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading