# Benchmarks: Julia vs Python+Numba

**URL:** <https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709>\
**Category:** Performance\
**Tags:** benchmark, python\
**Created:** [January 31, 2018, 8:35am UTC](https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709 "2018-01-31T08:35:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [January 31, 2018, 8:35am UTC](https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709/1 "2018-01-31T08:35:37Z")

</div>

Just sharing -

I started running some reality checks. I hope experiments like this would re-enforce our assessment about Julia’s greatness in performance, as compared to the Python+Numba ecosystem.

Only one notebook is posted so far:  
[https://github.com/tk3369/JuliaVsPythonNumba](https://github.com/tk3369/JuliaVsPythonNumba)

If anyone is interested in running additional reality checks, there are quite a few examples at this repo. Let me know if you want to collaborate so we don’t duplicate any efforts.

[https://github.com/ContinuumIO/numbapro-examples](https://github.com/ContinuumIO/numbapro-examples)

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 31, 2018, 8:41am UTC](https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709/2 "2018-01-31T08:41:33Z")

</div>

Some would call these things “benchmarks” 😄

I don’t understand why you code the functions as loops. Unless I missed something, they just vectorize a Black-Scholes. You could just broadcast, which would (I expect) do the same thing, but be more idiomatic.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [January 31, 2018, 8:46am UTC](https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709/3 "2018-01-31T08:46:23Z")

</div>

The code is intentionally made to be exactly the same as in Python’s implementation 😉

The point that I’m trying to prove -  
Without additional effort in code optimization, a Julia program should run faster by default. If the code sucks (like in this case) then the Python version should equally suck and therefore it would still be a fair comparison.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 31, 2018, 8:51am UTC](https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709/4 "2018-01-31T08:51:58Z")

</div>

I did not say that the code does “sucks”, it is just that one could write it differently.

Also, if I remember correctly, you can get call from the put prices from parity, or vice versa. I would just return either (for both Python and Julia, to be consistent). YMMV.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [January 31, 2018, 2:45pm UTC](https://discourse.julialang.org/t/benchmarks-julia-vs-python-numba/8709/5 "2018-01-31T14:45:29Z")

</div>

IHaha… I thought that might be a strong word when I wrote the post but that’s how Americans describe these things (I hear them all the time from my kids and got influenced 🤣)
