Skip to content

Commit

Permalink
fix[rust]: remove benchmarking code
Browse files Browse the repository at this point in the history
  • Loading branch information
matteosantama committed Aug 19, 2022
1 parent f21e2e1 commit 35e70b4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 35 deletions.
3 changes: 1 addition & 2 deletions polars/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2",
csv-core = { version = "0.1.10", optional = true }
dirs = "4.0"
flate2 = { version = "1", optional = true, default-features = false }
lexical = { version = "6", optional = true, default-features = false, features = ["std", "parse-floats", "parse-integers", "write-floats"] }
lexical = { version = "6", optional = true, default-features = false, features = ["std", "parse-floats", "parse-integers"] }
lexical-core = { version = "0.8", optional = true }
memchr = "2.4"
memmap = { package = "memmap2", version = "0.5.2", optional = true }
Expand All @@ -55,7 +55,6 @@ polars-arrow = { version = "0.23.0", path = "../polars-arrow" }
polars-core = { version = "0.23.0", path = "../polars-core", features = ["private"], default-features = false }
polars-time = { version = "0.23.0", path = "../polars-time", features = ["private"], default-features = false, optional = true }
polars-utils = { version = "0.23.0", path = "../polars-utils" }
rand = "0.8.5"
rayon = "1.5"
regex = "1.5"
serde = { version = "1", features = ["derive"], optional = true }
Expand Down
31 changes: 0 additions & 31 deletions polars/polars-io/src/csv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,3 @@ use crate::mmap::MmapBytesReader;
use crate::predicates::PhysicalIoExpr;
use crate::utils::resolve_homedir;
use crate::{RowCount, SerReader, SerWriter};

#[cfg(test)]
mod tests {
extern crate test;

use polars_core::prelude::*;
use rand::prelude::*;
use test::Bencher;

use crate::csv::CsvWriter;
use crate::SerWriter;

#[bench]
fn benchmark_write_csv_f32(b: &mut Bencher) -> Result<()> {
// NOTE: This benchmark can be run by executing ``$ cargo bench -p polars-io``
// from within /polars/polars/
const N: usize = 10_000_000;

let vec: Vec<f32> = (0..N).map(|_| thread_rng().next_u32() as f32).collect();

let mut df = df![
"random" => vec.as_slice(),
]?;

let mut buffer: Vec<u8> = Vec::new();

b.iter(|| CsvWriter::new(&mut buffer).finish(&mut df));

Ok(())
}
}
1 change: 0 additions & 1 deletion polars/polars-io/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(test)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(feature = "private")]
Expand Down
1 change: 0 additions & 1 deletion py-polars/Cargo.lock

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

0 comments on commit 35e70b4

Please sign in to comment.