Efficient way to get indices of true elements from BitArray

Why do you think it’s slow? I agree with Matt that it’s a slightly unusual way to write findall, but it seems to give the same performance.

julia> x = rand(Bool, 1_000_000);

julia> using BenchmarkTools

julia> @btime findall($x);
  4.927 ms (2 allocations: 3.81 MiB)

julia> @btime (1:length($x))[$x];
  4.479 ms (2 allocations: 3.81 MiB)