Performance tips on turning arrays into tuples

Note that I said “I benchmark carefully” and that for most performance critical code I find ntuple fastest”

There is no contradiction.

You too should benchmark carefully with something representative of your use case.

The two major cases I have were tuples that needed to correspond to fields of a struct, and tuples that corresponded to dimensions of an array.
In both cases we are talking about much less than 10 elements.

Benchmarking is crucial when you are trying to put the last shine on something.

3 Likes