Live data from Hacker News

PyPy.js: Now faster than CPython

rfk.id.au

51–60 of 80 posts

Re: PyPy.js: Now faster than CPython

#51
post #41
post #38

Earlier quoted context omitted.

The point was that once people are looking at restructuring the code base and re-writing parts of it, it also becomes a point of evaluation other technologies and frameworks. So there is a high chance many will not switch Python 2 -> Python 3 but Python 2 -> Go or something else. Then well ok, the answer to "What did Python 3 bring to the Python community?" becomes "Yeah it ended up driving a lot of people away", whi…

So switching Python 2 -> Python 3 is a higher cost than Python 2 -> Go?!?

Or something else, yes. If the cost is potentially going to be big enough to convert for a large code base (keeping in mind testing might be a huge part of it - having to potentially re-test everything), and for very little benefit (well, unicode possibly, but it's not like Python 3's really any faster, and the GIL's still there), it makes you evaluate if it's worth enduring a bit more transition pain to convert to something else completely which would bring the possibility of new features / better speed.

It's also quite an issue for COTS software - sometimes to jump forwards and clean up APIs they have to do a huge refactor, sometime even a re-write of the API. If this is troublesome enough, it's worth taking the time to look into the competition.

Re: PyPy.js: Now faster than CPython

#52
post #42
post #2

I felt it was a grave mistake for Python to direct the community effort into backwards incomparable Python 3, rather than on focusing on the speed (and better profiling instrumentation) of Python 2 (perhaps adding a standard JIT compiler). As a result, had our company started now, we would have written our Twisted server in C or Go instead of Python like we did.

Meanwhile, refactored PHP makes Wordpress 20% faster. http://news.php.net/php.internals/73888 , https://wiki.php.net/phpng and https://news.ycombinator.com/item?id=7699322 HHVM and now PHP 5.7-dev, both with JIT - the future of PHP looks bright. Starting a new project, we would choose PHP, Node.js or Go according to the requirements.

Yeah, so refactored PHP makes a PHP app 20% faster.

But you might actually not like to hear Node's V8 engine is between 50 and 150 times faster than PHP in synthetic benchmarks, and about 20 times faster in more diversified applications (as long as they don't sit an eternity blocking waiting on a DB call which is the way people did web apps 10 years ago). That's 2000% faster than PHP, just so we use the same units here.

I'm very happy PHP is getting faster and all, but just don't juxtapose it next to JS engines (which the article talks about), let alone something more serious like the JVM, because the "bright future" of PHP starts looking quite dim in comparison.

Re: PyPy.js: Now faster than CPython

#53
post #51
post #41

Earlier quoted context omitted.

So switching Python 2 -> Python 3 is a higher cost than Python 2 -> Go?!?

Or something else, yes. If the cost is potentially going to be big enough to convert for a large code base (keeping in mind testing might be a huge part of it - having to potentially re-test everything ), and for very little benefit (well, unicode possibly, but it's not like Python 3's really any faster, and the GIL's still there), it makes you evaluate if it's worth enduring a bit more transition pain to convert to…

I wouldn't consider rewriting in a complete different language, without any support for idiomatic Python code a "bit more transition pain".

GIL only exists on CPython, there are other implementations.

Re: PyPy.js: Now faster than CPython

#54
post #20
post #17

Earlier quoted context omitted.

Did you consider PyPy? It kinda works and it kinda focuses effort on being a faster replacement.

PyPy is good. I wish there was more moment and more _pull_ for it from the main Python team. I feel the big push for the last 3-4 years should have been for PyPy (or performance and tooling in general). PyPy is good. I wish there was more moment and more _pull_ for it from the main Python team. I feel the big push for the last 3-4 years should have been for PyPy (or performance and tooling in general). EDIT: To expan…

I think you're a little hard on Guido. CPython had amassed quite a few C extensions by that point. PyPy changes the low-level API in numerous significant ways. If Guido were to merge CPython with PyPy it would break all of those extensions. These extensions are in no small part the reason why Python is so popular. If he were to break all of this work, he'd piss off quite a few people. Many of the same people that helped him make Python what it is today.

Now I agree with you having PyPy's performance improvements in the main implementation would be awesome, and PyPy itself is quite impressive. If they could get both NumPy running on PyPy and support Python 3's changes, it would keep Python a strong competitor for the foreseeable future.

And to your last point, I entirely agree Python 2.0 had so many strengths that it's really hard to improve upon it. Though I think that it's unicode support was the big hairy wart.

Re: PyPy.js: Now faster than CPython

#55
post #42

Earlier quoted context omitted.

Meanwhile, refactored PHP makes Wordpress 20% faster. http://news.php.net/php.internals/73888 , https://wiki.php.net/phpng and https://news.ycombinator.com/item?id=7699322 HHVM and now PHP 5.7-dev, both with JIT - the future of PHP looks bright. Starting a new project, we would choose PHP, Node.js or Go according to the requirements.

Yeah, so refactored PHP makes a PHP app 20% faster. But you might actually not like to hear Node's V8 engine is between 50 and 150 times faster than PHP in synthetic benchmarks, and about 20 times faster in more diversified applications (as long as they don't sit an eternity blocking waiting on a DB call which is the way people did web apps 10 years ago). That's 2000% faster than PHP, just so we use the same units he…

It depends, for things like Web Sockets Node.js is really good. But for other things, HHVM (Facebook's HipHop JIT) and the new PHP 5.7 dev with JIT are really fast.

Check out an independent benchmark for comparision: http://www.techempower.com/benchmarks/#section=data-r9&hw=i7...

Re: PyPy.js: Now faster than CPython

#56
post #20

Earlier quoted context omitted.

PyPy is good. I wish there was more moment and more _pull_ for it from the main Python team. I feel the big push for the last 3-4 years should have been for PyPy (or performance and tooling in general). PyPy is good. I wish there was more moment and more _pull_ for it from the main Python team. I feel the big push for the last 3-4 years should have been for PyPy (or performance and tooling in general). EDIT: To expan…

I think you're a little hard on Guido. CPython had amassed quite a few C extensions by that point. PyPy changes the low-level API in numerous significant ways. If Guido were to merge CPython with PyPy it would break all of those extensions. These extensions are in no small part the reason why Python is so popular. If he were to break all of this work, he'd piss off quite a few people. Many of the same people that hel…

> I think you're a little hard on Guido

Perhaps you are right. My bitterness was coming through. It no t just that he said but how he said it.

In a way Python 3.0 also broke compatibility, for what I think, are not very good reasons. Some of that code was from people/companies who have adopted and used Python and made it popular. They are now living on a dead-end maintenance only branch.

Re: PyPy.js: Now faster than CPython

#57

In the browser environment, people usually use quite a few inline anonymous functions. Javascript is great at this since you can define full-blown anonymous functions anywhere. Python, on the other hand, is definitely one of the worst at this. You can only create one-line, single-expression anonymous function with its lambda keyword. Of all the languages you want to convert to JS so that it runs on the browser, Pytho…

I really don't understand this obsession with anonymous functions. If you're doing anything longer than one line, there is absolutely no reason why you should be sticking the entire function definition as a parameter.

I've had great usage from Javascript where I have separate functions with proper names and formatting, and then pass a reference to them into the code that asks for them.

Can someone please enlighten me about this whole anonymous functions thing that Javascript seems to have popularized? What are some of the pro's of using it over regular named/defined functions that sit by themselves and are reusable.

Re: PyPy.js: Now faster than CPython

#58
post #53
post #51

Earlier quoted context omitted.

Or something else, yes. If the cost is potentially going to be big enough to convert for a large code base (keeping in mind testing might be a huge part of it - having to potentially re-test everything ), and for very little benefit (well, unicode possibly, but it's not like Python 3's really any faster, and the GIL's still there), it makes you evaluate if it's worth enduring a bit more transition pain to convert to…

I wouldn't consider rewriting in a complete different language, without any support for idiomatic Python code a "bit more transition pain". GIL only exists on CPython, there are other implementations.

GIL also exists on PyPy.

Re: PyPy.js: Now faster than CPython

#59
post #56

Earlier quoted context omitted.

I think you're a little hard on Guido. CPython had amassed quite a few C extensions by that point. PyPy changes the low-level API in numerous significant ways. If Guido were to merge CPython with PyPy it would break all of those extensions. These extensions are in no small part the reason why Python is so popular. If he were to break all of this work, he'd piss off quite a few people. Many of the same people that hel…

> I think you're a little hard on Guido Perhaps you are right. My bitterness was coming through. It no t just that he said but how he said it. In a way Python 3.0 also broke compatibility, for what I think, are not very good reasons. Some of that code was from people/companies who have adopted and used Python and made it popular. They are now living on a dead-end maintenance only branch.

Read http://python-notes.curiousefficiency.org/en/latest/python3/... and tell me if you still not convinced.

Re: PyPy.js: Now faster than CPython

#60
post #56

Earlier quoted context omitted.

> I think you're a little hard on Guido Perhaps you are right. My bitterness was coming through. It no t just that he said but how he said it. In a way Python 3.0 also broke compatibility, for what I think, are not very good reasons. Some of that code was from people/companies who have adopted and used Python and made it popular. They are now living on a dead-end maintenance only branch.

Read http://python-notes.curiousefficiency.org/en/latest/python3/... and tell me if you still not convinced.

Read it, still not convinced. Have you read what I wrote though? I think I was pretty clear that I knew about changes and knew about other things (iterator views) etc.

None of those things make me want to get up roll up my sleeves and say "I can't wait to dig in and make my code compatible with 3.4". If I woke up tomorrow and someone would have magically done that for me and tested it, yeah great. I would buy them a beer. But that is about it. I have 0 incentive today to upgrade.

Code works very well now just using unicode support from Python 2 and print as a statement + other warts.

Post reply on HN