Why polars csvReader in Rust is slower then in python-polars lib?

Hi, I try to read large csv file itno DataFrame via rust-polars lib .

CSV file has 3 mln rows. Via polars-rust it takes about 14s but via polars-python it takes 0.5 sec.
Why "pure" rust is so slow ? Where is my mistake ?

Rust code :

fn example() -> Result<DataFrame> {
   let df =  CsvReader::from_path("3mlnrows.csv")?

fn main() {
    if let Err(err) = example() {
        println!("error running example: {}", err);

Python code :

import polars as pl 
df = pl.read_csv("3mlnrows.csv")

Thanks in advance for answer .

Obligatory question: Did you run it with --release?


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.