Can anyone help explain why MapThread is so slow in this simple case?
p = 0.1;
t = Table[1, {10^6}];
SeedRandom[1000];
AbsoluteTiming[
AbsoluteTiming[a a=Map[#= Map[# RandomChoice[{p, 1 - p} -> {1, 0}] &,t];
]t];]
SeedRandom[1000];
AbsoluteTiming[
AbsoluteTiming[b b=MapThread[#= MapThread[# RandomChoice[{p, 1 - p} -> {1, 0}] &,
{t}];
]];]
Norm[a-b]
outputs
{0.555723, Null}
{3.696282, Null}
0