modern-polars icon indicating copy to clipboard operation
modern-polars copied to clipboard

Possible typo in performance comparison

Open avi-cenna opened this issue 1 year ago • 2 comments

I was reading this section of the Modern Polars article, and I think there's an issue with the claim that Polars is 150x faster. That number doesn't seem to align with the results in the code blocks where the %%time command is used to produce timings.

avi-cenna avatar Jul 23 '24 17:07 avi-cenna

Yeah this is a vague estimate because it's different every time I run it

kevinheavey avatar Aug 27 '24 12:08 kevinheavey

I just checked again and this is the difference.

Polars:

CPU times: user 1.78 s, sys: 197 ms, total: 1.98 s
Wall time: 216 ms

Pandas:

CPU times: user 3.55 s, sys: 347 ms, total: 3.9 s
Wall time: 3.9 s

So polars is about 18 times faster, if we're looking at wall time. That's pretty far from 150x. For the sake of clarity, I think it might be helpful to the reader to give an explanation of the difference between wall time and CPU time and clarify that you're specifically comparing wall time. I actually didn't even notice that you were comparing the wall time until just now.

avi-cenna avatar Sep 10 '24 12:09 avi-cenna