Any good resources for learning Data Oriented Design and Data Driven Programming in Rust?

Ah yes.

That Intel loop-blocking discussion is perhaps an extreme case.

Typically if you want to process elements of a big 2D array it's better to work through the rows and columns in such a way that you are always steeping up in memory address and your cache always has the data you need on hand.

But that Intel example is sneaky. It accesses one array with (i, j) and the other with (j, i).

Clearly walking up memory for one is optimal, but it is a disaster for the other as it has to jump around memory trying to access the correct row and column.

loop-blocking is then a compromise to try and keep the caches useful for accessing both arrays at the same time. One has to tune the block size to suite ones cache size.

Such loop blocking is likely very sub-optimal for traversing a single array. Or even two arrays in the normal order.

1 Like

Here is a good resource although not specifically Rust: https://github.com/dbartolini/data-oriented-design

I would suggest playing around with and reading the code for https://github.com/TomGillen/legion and https://github.com/amethyst/specs to get a feel for how two different implementations try to do the same thing.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.