by cygnus_a · 11y ago · 0 comments
- Python has easy development (https://xkcd.com/353/)
- Great libraries (ie, free matlab)
- Cython for efficiency via C
- The algorithms themselves determine speediness (ie numerical methods)
This is so important I wish people would focus more on it. I recently rewrote some Javascript code in (pure) python and got a good 2 orders of magnitude speed up on large inputs just by picking the right data structures and replacing an O(n^3) nested loop with an O(n log n) approach.
We do scientific computing at my company. Numpy does 90% of the work, but there are some algorithms that just aren't easily expressed with arrays. That's where Cython comes in.
I tried a very simple toy program the other day and while I had to write some things slightly un-pythonically (it can't deal with syntax like a[:] = b+c yet), it performed practically as good as hand-written C code.