News for hackers. Stuff that matters.
Re:Grumpy: Go running Python by naasking on Wednesday January 04, 2017 @12:29PM (#13320176)
I wonder why the Grumpy Fibonacci is so much slower than CPython for 1 thread. Seems weird given Grumpy is compiled.
Re:Grumpy: Go running Python by trotterdylan on Wednesday January 04, 2017 @01:44PM (#13320908)
Although Grumpy is compiled, it is just as dynamic as Python, in that method dispatch involves dictionary lookups, etc.

The main reason why Grumpy's slower for most single threaded benchmarks is that most Python workloads involve creating and freeing a bunch of small Python objects. In Go, these objects are garbage that need to be GC'd in a very general way. In CPython, there are free lists, arenas and other optimizations for allocating small (especially immutable) objects. And cleaning up garbage in CPython involves pushing unreferenced objects back onto the free lists for later reuse.

Re:Grumpy: Go running Python by naasking on Wednesday January 04, 2017 @03:17PM (#13321680)
> Although Grumpy is compiled, it is just as dynamic as Python, in that method dispatch involves dictionary lookups, etc.

Right, I suppose I assumed that straightforward numerical-looking code would be translated to Go numerical code. Perhaps they just aren't that ambitious yet.

Re:Grumpy: Go running Python by trotterdylan on Wednesday January 04, 2017 @08:03PM (#13323787)
We hope to implement optimizations like you're describing eventually. But the core functionality needs a lot of work before we start down that path.
Re:Grumpy: Go running Python by machbio on Wednesday January 04, 2017 @12:47PM (#13320360)
Guido insists that single threaded performance of Python has the highest priority - http://www.artima.com/weblogs/viewpost.jsp?thread=214235

I am not sure, any implementation of Python will beat the single threaded performance of Cpython..

Re:Grumpy: Go running Python by Veedrac on Wednesday January 04, 2017 @01:00PM (#13320478)
CPython is still a naïve interpreter. PyPy beats it in most cases, sometimes by a lot. Of course, PyPy still has a GIL for the same reasons CPython does.
Re:Grumpy: Go running Python by dom0 on Thursday January 05, 2017 @09:48AM (#13327457)
So your complaint is that GVR doesn't want patches that would (significantly) regress performance for the majority of use cases, yes?
Re:Grumpy: Go running Python by dekhn on Wednesday January 04, 2017 @01:03PM (#13320513)
IIRC, IronPython single-threaded performance was competitive with CPython.
Re:Grumpy: Go running Python by throwaway91111 on Wednesday January 04, 2017 @01:49PM (#13320965)
Multiple ones already do.
Re:Grumpy: Go running Python by sgift on Wednesday January 04, 2017 @12:37PM (#13320260)
From the post it looks like it is optimized for multithreading from the start, so they possibly used the multithreaded version with thread count = 1. When you care for parallel workloads its not so important if your single-threaded code is the fastest.