3 added 1 character in body
source | link

If you need it really fast, then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722

If you need it really fast then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722

If you need it really fast, then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722

2 edited body
source | link

OfIf you need it really fast then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722

Of you need it really fast then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722

If you need it really fast then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722

1
source | link

Of you need it really fast then use Compile:

n = 1000000;
a = RandomReal[{-1, 1}, {n, 2, 2}];
b = RandomReal[{-1, 1}, {n, 2, 2}];

cf = Compile[{{a, _Real, 2}, {b, _Real, 2}},
   b.a.b,
   RuntimeAttributes -> Listable,
   Parallelization -> True
   ];

MapThread[Dot, {b, a, b}]; // AbsoluteTiming // First
cf[a, b]; // AbsoluteTiming // First

1.46343

0.075722