The LAPACK routine that does this modifies the right-hand side directly. It is interfaced via lmul!(Q, x). I’m guessing it’s an oversight that the corresponding mul! method is missing.

The mul! function falls back to a generic method, which becomes extremely slow since the elements of Q take time to compute. It should be easy to write the missing method as it just needs to copy x into y and then call lmul!.

I ran into this issue for a QRPackedQ from a qr with pivoting.

MWE:

x = rand(64,64);
y = rand(64,64);
z = rand(64,64);
F = qr(x, Val(true));
@time mul!(x, F.Q, y);
@time mul!(x, Matrix(F.Q), y);
@time mul!(x, y, y);
# even worse if we want to use an adjoint
@time mul!(x, F.Q', y);
@time mul!(x, Matrix(F.Q)', y);
@time mul!(x, y', y);