# Why are calls to this function slow, compared to Python+Numpy?

**URL:** <https://discourse.julialang.org/t/why-are-calls-to-this-function-slow-compared-to-python-numpy/5346>\
**Category:** General Usage\
**Tags:** fast-math\
**Created:** [August 12, 2017, 12:47pm UTC](https://discourse.julialang.org/t/why-are-calls-to-this-function-slow-compared-to-python-numpy/5346 "2017-08-12T12:47:59Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 12, 2017, 11:55pm UTC](https://discourse.julialang.org/t/why-are-calls-to-this-function-slow-compared-to-python-numpy/5346/13 "2017-08-12T23:55:31Z")

</div>

This computesthe same thing as the original post about 10x faster on my machine, without “cheating” using threads:

```julia
function test(s,a)
         g = Vector{Float64}(s)
         ap1= a+1
         ap1inv = inv(ap1)
         @inbounds for i =1:s
           k = i+1.0
           @fastmath g[i] = (k^ap1-(k-1)^ap1)*ap1inv
         end
end

```

---

_[View the full topic](https://discourse.julialang.org/t/why-are-calls-to-this-function-slow-compared-to-python-numpy/5346)._
