133 points · by ogogmad · 6y ago · 53 comments
[1]: https://morepypy.blogspot.com/2012/01/py3k-and-numpy-first-s...
[2]: https://morepypy.blogspot.com/2014/06/pypy3-231-fulcrum.html
docker run pypy:2.7-7.3.2 python -c "print 'no quotes, integer division %s / %s => %s' % (5, 3, 5 / 3)"
no quotes, integer division 5 / 3 => 1
Edit: i mean no parenthesisI have to say that their official benchmarks point out a performance comparison to python 2.7, and at this time that sounds irrelevant - comparison to Python 3 would be relevant.
https://doc.pypy.org/en/latest/faq.html#how-long-will-pypy-s...
PyPy is written in RPython, which is a subset of Python 2 without most of the dynamic features, so it can be compiled. Moving it to a subset of Python 3 would be a major effort, as they would have to rewrite both the PyPy code and the RPython compiler.
And RPython, being a subset of Python, can also be interpreted, so they probably want to keep the Python 2 interpreter so they can interpret it.
The faq that you've linked says that RPython will continue to run on Python 2 as long as Pypy exists, it says nothing about running RPython on Python 3 interpreter.
I think that they should switch to displaying and talking about Py 3 comparison benchmarks to give the impression that they are a non-legacy project.
https://www.pypy.org/features.html
> Our main executable comes with a Just-in-Time compiler. It is really fast in running most benchmarks—including very large and complicated Python applications, not just 10-liners.
> There are two cases that you should be aware where PyPy will not be able to speed up your code:
> Short-running processes: if it doesn't run for at least a few seconds, then the JIT compiler won't have enough time to warm up.
> If all the time is spent in run-time libraries (i.e. in C functions), and not actually running Python code, the JIT compiler will not help.
CFFI-based modules should work without a big penalty, but these are generally slower than extension modules.
What I have heard, though, is that string operations are more expensive in pypy than cpython.
Regardless, performance gains and regressions are unlikely to generalize; what's true for someone else's project may not be true for yours. If you're concerned about performance, I recommend benchmarking your own codebase.
def main(n):
# Note: exact value of n and prints are significant, don't change
a = [0] * n
for _ in range(n):
pos = -1
for i in range(n):
if i > 0:
print(a[i - 1], end="")
pos = i
print(a[pos], _, n)
main(191)Clojure, Kotlin and Scala are guests with temporary permit until the landlord acquires all features that matter to the masses, then they will join Beanshell and friends.
Julia and Common Lisp are the landlords of their own stacks.
As for the feature of the language themselves, I always considered myself polyglot, using the platform languages for each kind of deployment scenario.
I would hate for someone to do all that work only to end up with a fork
Is there any chance for Pypy to work with Numba, especially with HPy coming? Yes, they're both JIT compilers, but I feel like the kind of optimizations they do are complementary rather than redundant. I want fast business logic with fast algorithmic code in the hot parts :)
Is it "for new code which is maths/vector heavy and not relying on any existing environment, Julia is a valid competitor to pypy"? Or is there a better qualifier?
99%? You won't get the most recent versions because a lot of packages started requiring v1.3 when the new AD and multhreading mechanisms came out, but you can still boot up the LTS and run any standard analysis that existed back when 1.0 was around, which is something like 3000+ packages. Where is your FUD coming from?
https://benchmarks.sciml.ai/html/MultiLanguage/wrapper_packa...
https://gist.github.com/ChrisRackauckas/cc6ac746e2dfd285c28e...
https://gist.github.com/ChrisRackauckas/4a4d526c15cc4170ce37...
are the ones from the top of my head.
Also I should note that Julia performance greatly improved since. Next week there should be the 1.6.0 release, which will have even better numbers.