# In-place mul! much slower than \* for real-complex matrix multiplication

**URL:** <https://discourse.julialang.org/t/in-place-mul-much-slower-than-for-real-complex-matrix-multiplication/134938>\
**Category:** Performance\
**Created:** [January 7, 2026, 2:58pm UTC](https://discourse.julialang.org/t/in-place-mul-much-slower-than-for-real-complex-matrix-multiplication/134938 "2026-01-07T14:58:18Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 8, 2026, 6:23am UTC](https://discourse.julialang.org/t/in-place-mul-much-slower-than-for-real-complex-matrix-multiplication/134938/10 "2026-01-08T06:23:12Z")

</div>

This issue has been discussed in this topic:

> [@In-place multiplication is too much slower for ComplexF64](https://discourse.julialang.org/t/in-place-multiplication-is-too-much-slower-for-complexf64/75887):
>
> The ordinary version: using BenchmarkTools const p = 60 const dd=randn(p,p) const ψ=randn(p,p\*p)+im\*randn(p,p\*p) function d2x(ψ::Array{ComplexF64,2})::Array{ComplexF64,2} ψr=dd\*ψ return ψr end @btime d2x(ψ); The result is 1.330 ms (4 allocations: 3.35 MiB) The in-place version: function d2x(ψ::Array{ComplexF64,2})::Array{ComplexF64,2} ψr = similar(ψ) mul!(ψr,dd,ψ) return ψr end @btime d2x(ψ); The result is 9.511 ms (8 allocations: 3.30 MiB) Is it a bug or somethin…

---

_[View the full topic](https://discourse.julialang.org/t/in-place-mul-much-slower-than-for-real-complex-matrix-multiplication/134938)._
