3 ms·
Spot on. One major reason why languages such as numpy are slow compared to what they are implemented in is precisely what you said, gratuitous creation and dest
by srean 13y ago
Spot on. One major reason why languages such as numpy are slow compared to what they are implemented in is precisely what you said, gratuitous creation and destruction of costly temporaries. In the Numpy world this can be mitigated somewhat with tools like numexpr. R is lazy, so I expected it to be faster than Numpy so was surprised that its is so much slower.
Julia seems headed in the right direction and I am very excited about it. I really wish they had a mechanism to desugar vectorization syntax in to dumb loops which could then be JITed. Vector syntax can be really expressive, aligned with the problem domain and succinct, I would hate to let go of that in the interest of speed. Its strange that many correlate verbosity with clarity/readability.
@ihnorton sadly I can only offer a single upvote
- ihnorton 13y agoYou might be interested in: https://github.com/lindahua/Devectorize.jl https://github.com/lindahua/Devectorize.jl (not 100% general yet AFAIK, but already very useful. The code is a great read too)