Conversation
|
This PR doesn't seem to impact the performance of the benchmark setups I looked at in #194. |
|
@piever thanks, I'll try the PR! I'm currently using this workaround in BAT.jl: _structvector_indexstyle(contents::Tuple) = _structvector_indexstyle_impl(map(IndexStyle, map(typeof, contents)))
_structvector_indexstyle_impl(::NTuple{N,IndexLinear}) where N = Int
_structvector_indexstyle_impl(::NTuple{N,IndexStyle}) where N = CartesianIndex{1}It also uses the values - it's a bit too simple (limited to vectors), but maybe the basic map-IndexStyle-over-contents approach could get rid of some of the recursion in the updated StructArrays code in this PR? |
|
@piever sorry for the delay - did a few additional tests - looks like this PR fixed the problem completely. Thanks! |
|
Great, thanks for double checking! |
|
Now StructArrays.jl/src/structarray.jl Line 26 in 99f0556 and some times takes types: Line 95 in 99f0556 Seems strange. |
|
It's true that it is a bit confusing. It turns out that we can just use |
Fix #203 by running the
index_typecomputation by recursing tuples rather than tuple types.@oschulz I think the basic mistake was to compute
index_typeon types rather than values. Does this PR fix your type instability problem?@ranocha this PR should not regress the performance improvements you introduced in #194, but I guess it'd be good to double check it in practice if you have a simple way to run the performance benchmarks on Trixi based on this PR