-
Notifications
You must be signed in to change notification settings - Fork 612
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
docs(blog-post): pydata performance part 2; polars and datafusion #7703
docs(blog-post): pydata performance part 2; polars and datafusion #7703
Conversation
/preview |
The Polars backend test failures are from the change to set
|
Found a difference between the polars implementation and the ibis implementation, but it's unlikely to explain the 10x delta: I am calling |
ba38fd6
to
ee31e19
Compare
/preview |
Thank you for the ping @cpcloud -- we will check this out shortly Tracking in apache/datafusion#8492 |
Interesting! I can't run the Polars version with |
20e90b6
to
96ff79d
Compare
/preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Three small comments, but I'd say this is ready to go.
1947685
to
34ce32d
Compare
Rendering now |
a86a673
to
fb37562
Compare
/preview |
fb37562
to
57b5c8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small things I noticed, neither blocking
57b5c8c
to
0ffb296
Compare
df.head() | ||
``` | ||
|
||
### DataFusion and Polars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not showing up in the rendered html for some reason (which is very annoying)
2b54b98
to
bf0b7ec
Compare
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
bf0b7ec
to
7f5d5b3
Compare
Alright, once the preview finishes and looks good I will merge this! Thanks all! |
This PR adds a new blog post as a follow up to part 1.
The purpose of the post is to continue comparing the performance of the same
workload from part 1 against Polars and DataFusion.
TL; DR: Polars and DataFusion take about the same time to complete this
workload, somewhere between 8 to 10 minutes.
DuckDB completes this workload in about 40 to 60 seconds.
Details
Polars
Polars ran out of memory out of the box, so I added the
streaming=True
flagto
collect
calls in all cases (the Ibis implementation and the Polars nativeAPI implementation).
I am aware that streaming execution is in an alpha state, but I'm not aware of
any other way to complete the workload without getting a machine with more
memory.
Memory use was still pretty high (mid 30GBs) and the workload segfaulted when
run on a machine with 64GB (different from the one I benchmarked on which has
about 94GB), but I was able to reliably complete the workload on my larger
cloud host.
Note that I compare the Ibis version with the Polars native API version to rule
out any large differences in performance caused by Ibis. Both methods have the
same performance characteristics.
I took a look at
perf top
while the Polars native workload was running and I sawa few expected things and some surprising-to-me things, especially the
getenv
calls:DataFusion
DataFusion never ran out of memory and had a memory profile similar to DuckDB:
single digit GBs peak memory.
However, it was still extremely slow compared to DuckDB, about 9-10 minutes to
run the whole workload.
Similarly to Polars I compared both the Ibis implementation and a hand-written
SQL version (built from the generated Ibis code). Both had the same performance
I also looked at
perf top
while the DataFusion workload was running and saw this:Next steps
I'd like to work with the community to see if I can do something to improve the
performance in either or both of Polars and DataFusion.
cc @ritchie46 @alamb
Would love y'all to take a look at what I'm doing and let me know how to get
better performance.
Note: all of the version and system information is in the preview links below, but here it is for ease of use: