Yeah, here it’s a bit tricky because somehow the PooledArray constructor is type-unstable
julia> using PooledArrays, Test
julia> @inferred PooledArray(rand(1:3, 100))
ERROR: return type PooledVector{Int64, UInt32, Vector{UInt32}} does not match inferred return type PooledArray{Int64}
so you do need the find_ia function barrier (that had also tricked me initially into believing that find_ia was much more expensive).