# Why is this Julia code considerably slower than Matlab

**URL:** https://discourse.julialang.org/t/why-is-this-julia-code-considerably-slower-than-matlab/2365
**Category:** New to Julia
**Tags:** performance
**Created:** [February 28, 2017, 3:03pm UTC](https://discourse.julialang.org/t/why-is-this-julia-code-considerably-slower-than-matlab/2365 "2017-02-28T15:03:36Z")
**Posts on this page:** 1
**Showing post:** 50

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [March 1, 2017, 7:55pm UTC](https://discourse.julialang.org/t/why-is-this-julia-code-considerably-slower-than-matlab/2365/50 "2017-03-01T19:55:37Z")

</div>

> [@RoyiAvital](#):
>
> @DNF, Could you tell the timing of the run when you used Julia’s sin and cos?

The difference is marginal. Sometimes I see no difference, and sometimes it saves \<1 sec. Which is odd because the timing of

```julia
carrier_signal .= exp.(im.*α)

```

vs

```julia
carrier_signal .= complex.(cos.(α), sin.(α))

```

indicates that I should be saving 2-3 sec.

---

_[View the full topic](https://discourse.julialang.org/t/why-is-this-julia-code-considerably-slower-than-matlab/2365)._
