Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the draft pr to demonstrate the performance of polars lazyframes on 20240516 #1404

Conversation

maxim-uvarov
Copy link
Contributor

this pr is not intended to be merged.

```

This time it took us 0.6 seconds. Not bad at all.
This time it took us 0.00053 seconds. Not bad at all.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did this time come from? above it says 11 sec, which I don't understand either. I'm not sure how dataframes would be slower than nushell opening the same file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 seconds is the execution time inside numd script. I executed it manually now and it shows 5 seconds which is also above expectations.

0.00053 seconds is the time it took to create a lazyframe plan. I will fix it in the next commit.

@fdncred
Copy link
Collaborator

fdncred commented May 16, 2024

This is my timings from my Windows desktop that is not super fast. I didn't do the python timings.

 timeit {open Data7602DescendingYearOrder.csv}
5sec 244ms 662µs 400ns

 timeit {polars open Data7602DescendingYearOrder.csv | polars collect; null}
239ms 526µs 800ns

 timeit {
    open 'Data7602DescendingYearOrder.csv'
    | group-by year --to-table
    | update items {|i|
        $i.items.geo_count
        | math sum
    }
}
10sec 906ms 680µs 300ns

 cat load.nu
let df = polars open Data7602DescendingYearOrder.csv
let res = $df | polars group-by year | polars agg (polars col geo_count | polars sum)
$res | polars collect
 timeit {source load.nu}
155ms 678µs 500ns

@fdncred
Copy link
Collaborator

fdncred commented May 16, 2024

Just FYI - Regular nushell tables can emulate the polars output too.
nushell
image
polars plugin (had to add sort to get them in the same order)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants