Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TL;DR: D is faster than Python.


Is it though? Un-optimized Python vs. a D script iterated on 5 times?

Certainly eye-catching but I wouldn't call it conclusive.


No, it isn't debatable which is generally faster (D), but I was impressed that you could just prototype in Python (probably significantly faster than D) and run it through PyPy when you're done and get 90% of the performance of D. Of course Python has the bloat of the interpreter and Jitter, while D is just a binary. Point is I was expecting more speed from D. I'm curious if this is just luck or the two would be neck and neck on a range of tests?


Optimizing/squeezing performance out of Python is a rabbit hole:

https://www.ibm.com/developerworks/community/blogs/jfp/entry...

I would speculate using numba or Cython would yield further performance gains over PyPy...but that's mostly just based on anecdotal comparisons:

https://cardinalpeak.com/blog/faster-python-with-cython-and-...

I just think it is a bit dishonest to try and make a claim as pointed as this article's in 2017 by stopping at simply running an un-optimized CPython script with PyPy.


I think they're just giving you bounds on what to expect and not selling anything. The D optimizations looked a lot easier (write it slightly different) than mucking with Cython or Numba. Simply running through PyPy is another thing all together.


I don't know, a lot of benefit can be had from Cython by just declaring types and flagging for compilation:

http://cython.readthedocs.io/en/latest/src/tutorial/cython_t...

http://cython.readthedocs.io/en/latest/src/quickstart/cython...

But that is just my opinion.


Sure, was for saving time. In my opinion, that article could be more elaborated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: