Hacker News new | ask | show | jobs
by bb1234 1910 days ago
You said "The thing about Julia is that you can code without caring about performance (and the performance will be Python-like)."

This is not my experience. Even if you code without caring about performance it is way faster than Python. Also, it is not any harder to code in than Python. It is as high level if not more.

2 comments

> This is not my experience. Even if you code without caring about performance it is way faster than Python.

It is very usecase dependant. If your Python code is writing lots of loops and scalar processing then naive julia code will trash it. but if it is basically spending all its time in numpy/BLAS routines then they will be comparable. and Julia will looks like its not worth it, since compile time makes it overall slower etc.

> Also, it is not any harder to code in than Python.

If you already know Python then it is easier to use what you know. Furthemore, if you already know Python (or even more so Matlab) it can cause some stumbling blocks. Some idiomatic code in other languages, (like writing everything as big array operations), is unidiomatic in julia (since it causes a lot of allocations tht you don't need)

Yeah, that's often the case but I wanted to make a conservative claim.

Two personal examples where Julia turns out to be much much faster than Python without me having to do anything but the most naive implementation:

- order of 10 float arrays with order of 1_000_000 elements each. Broadcasting an element-wise function in Julia or just doing a for-loop in Julia is way way faster than a pandas operation like col1 * col2 + col3 etc.

- the first time I tried one of Julia's optimizers (I think Optim.jl) it took 1ms on my problem. Sci-kit took 200ms. That's crazy.