# Dot product

**URL:** <https://discourse.julialang.org/t/dot-product/128704>\
**Category:** General Usage\
**Tags:** linearalgebra\
**Created:** [May 5, 2025, 6:40am UTC](https://discourse.julialang.org/t/dot-product/128704 "2025-05-05T06:40:56Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [May 6, 2025, 12:37am UTC](https://discourse.julialang.org/t/dot-product/128704/6 "2025-05-06T00:37:04Z")

</div>

I watched that video. I prefer the current (julia’s) behavior, comparing to other languages.

Yes, `dot(x, y)` calls `BLAS`, which is specialized.  
Looks like `sum(x .* y)` will call `mapreduce` and therefore resolves into standard `+` and `*` operations (perhaps calling standard C functions?).

Moreover, it appears that `dot(x, A, y)` also outperforms `x' * A * y`, at least in terms of allocations, sometimes also in time (can someone do a test?).

---

_[View the full topic](https://discourse.julialang.org/t/dot-product/128704)._
