Why are some float < integer comparisons four times slower than others?

When comparing floats to integers, some pairs of values take much longer to be evaluated than other values of a similar magnitude. For example: >>> import timeit >>> timeit.timeit(“562949953420000.7 < 562949953421000”) # run 1 million times 0.5387085462592742 But if the float or integer is made smaller or larger by a certain amount, the comparison runs … Read more

Python vs Cpython

What’s all this fuss about Python and CPython (Jython,IronPython), I don’t get it: python.org mentions that CPython is: The “traditional” implementation of Python (nicknamed CPython) yet another Stack Overflow question mentions that: CPython is the default byte-code interpreter of Python, which is written in C. Honestly I don’t get what both of those explanations practically … Read more

Why shouldn’t I use PyPy over CPython if PyPy is 6.3 times faster?

I’ve been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site. Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, they say PyPy is 6.3 times faster. The second issue is parallelism, the infamous … Read more