Live data from Hacker News

Python 3.14 is here. How fast is it?

blog.miguelgrinberg.com

151–160 of 579 posts

Re: Python 3.14 is here. How fast is it?

#151

Very nice post - it's good to see benchmarks done for humans. For fun, I tried this in Raku: (0, 1, *+* ... *)[40] #0.10s user 0.03s system 63% cpu 0.214 total lol Seriously, Python is doing great stuff to squeeze out performance from a scripting language. Realistically, Raku has fewer native libraries (although there is Inline::Python) and the compiler still has a lot of work to get the same degree of optimisation (…

I take it this is supposed to be the equivalent of fib(40), which ran on the author's system in Pyπ in 6.59 seconds and apparently on yours, with Raku, in 0.21?

Do you have the same hardware as the author or should one of you run the other's variant to make this directly comparable?

Re: Python 3.14 is here. How fast is it?

#153

Earlier quoted context omitted.

Obtuse statement. There are many ways of speeding up a python project if requirements change.

A painful rewrite in another language is usually the only option in my experience. If you're really lucky you have a small hot part of the code and can move just that to another language (a la Pandas, Pytorch, etc.). But that's usually only the case for numerical computing. Most Python code has its slowness distributed over the entire codebase.

It’s not painful, that’s the point. You have a working prototype now ready to port. (If the destination language is painful perhaps, but don’t do that.)

I recently ported a Python program to Rust and it took me much less time the second time, even though I write Rust more slowly per-line. Because I knew definitively what the program needed.

And if even that is too much optimizing the Python or adding Cython to a few hot loops is less difficult.

Re: Python 3.14 is here. How fast is it?

#154

What are the reasons why nobody uses pypy?

I keep wondering the same. It's a significant speed-up in most cases and equally easy to (apt) install

For public projects I default the shebang to use `env python3` but with a comment on the next line that people can use if they have pypy. People seem to rarely have it installed but they always have Python3 (often already shipped with the OS, but otherwise manually installed). I don't get it. Just a popularity / brand awareness thing I guess?

Re: Python 3.14 is here. How fast is it?

#155
post #70
post #10

Tangential, but I practically owe my life to this guy. He wrote the flask mega tutorial in what I followed religiously to launch my first website. Then right before launch, in the most critical part of my entire application; piping a fragged file in flask. He answered my stackoverflow question, I put his fix live, and the site went viral. Here's the link for posterity's sake https://stackoverflow.com/a/34391304/41802…

Cool story, but was your life really at risk in that situation?

[deleted]

Re: Python 3.14 is here. How fast is it?

#156
post #77
post #70

Earlier quoted context omitted.

Cool story, but was your life really at risk in that situation?

https://torrentfreak.com/tag/yout/

> Brazil Advances Criminal Prosecution of American Yout.com Operator

Touché! I see sibling comments assuming I was being sarcastic (without mandatory sarcasm tag!), but what I was really hoping for was more backstory like this. I guess it depends on how you read things in your head.

Re: Python 3.14 is here. How fast is it?

#157
seems loved languages such as python & ruby (ZJIT | TruffuleRuby) have been getting a lot performance improvements lately. of course JS with v8 kickstarted this - followed by PHP.

so for majority of us folks use what you love - the performance will come.

Re: Python 3.14 is here. How fast is it?

#158
post #82
post #27

I hope it doesn't get stuck at 3.14, like TeX. https://www.reddit.com/r/RedditDayOf/comments/7we430/donald_...

You hope it doesn't ? > [Donald Knuth] firmly believes that having an unchanged system that will produce the same output now and in the future is more important than introducing new features This is such a breath of fresh air in a world where everything is considered obsolete after like 3 years. Our industry has a disease, an insatiable hunger for newness over completeness or correctness . There's no reason we can't…

[deleted]

Re: Python 3.14 is here. How fast is it?

#159
post #74

What are the reasons why nobody uses pypy?

Because in the real world, for code where performance is needed, you run the profiler and either find that the time is spent on I/O, or that the time is spent inside native code.

When it's a drop-in replacement, as in most of my code (and it's dead simple to try if it runs when you use pypy ./main.py), I wouldn't know why you should run the code 5-50% slower for no reason though

Re: Python 3.14 is here. How fast is it?

#160

What are the reasons why nobody uses pypy?

It currently only supports Python 3.11. That is a big reason.

I was happy to see it supports a fairly recent Python3 at all now, like Py3.5 or what is it that ships with most of the expected stuff? Works for me, I'd target something like that for compatibility anyway
Post reply on HN