3 ms·
You didn't read the thread. The OPs code used very small arrays and using numpy was slowing the code down by an order of magnitude. The pure python solution i
by wffurr 13y ago
You didn't read the thread. The OPs code used very small arrays and using numpy was slowing the code down by an order of magnitude. The pure python solution is 17x faster.
- Jtsummers 13y agoYour other post [1] is marked as dead. The filters here will do that to duplicate posts (maybe within a time limit?). You may want to reply to that comment again with a rephrasing of this post rather than the same content. [1] https://news.ycombinator.com/item?id=7672744 https://news.ycombinator.com/item?id=7672744
- TillE 13y agoIt's really important to remember that the interface of a VM can be one of the slowest parts. When your LuaJIT code is making a ton of calls to tiny C functions, it's gaining hardly any benefit from the JIT.
- awj 13y agoYeah, things like marshaling data across the interface barrier, or chasing the pointer indirections inherent in calling functions, can have a significant cost. Usually it isn't significant enough, but as always the devil is in the details.
- muyuu 13y agoYep and anyone with any experience in NumPy won't use it that way.