Struggling with a strange performance issue

Well, that makes things clearer: the tree-dump for the optimised version shows that both get_elem_ndim and get_pointer are eliminated then. Hence the performance difference.

2 Likes