← Back to context

Comment by sanderjd

3 days ago

When you say "in-cache batches", you mean that this cache is on disk? Is that only the case when data is quite large?

(Or a more general question: What is the best resource for me to read about how the streaming engine and cache work?)

Well... once my recent work on out-of-core lands the batch could be on disk when we run out of memory budget ;)

But no, that's not what I meant. I meant that the batch is meant to be of a size that fits in your CPU cache. This can be a huge throughput improvement as each bit of data stays in cache as it moves from data source to sink.

Compare this to column-at-a-time execution: by the time you start the next operation on this column the start of the column will be out of cache again, meaning you operate at RAM speed (or worse, disk speed) rather than cache speed.

I gave a (fairly surface-level) talk on the streaming engine a bit over a year ago: https://pola.rs/posts/talk-polars-meetup-1-streaming-engine/.

  • Aaaaah, the cpu cache aspect is what I was missing! This makes tons of sense! I'll check out your talk as well.