Readit News logoReadit News
andylei commented on Python performance myths and fairy tales   lwn.net/SubscriberLink/10... · Posted by u/todsacerdoti
nu11ptr · 24 days ago
I would argue this isn't true. It is a big part of what makes it slow. The fastest interpreted languages are one to two orders of magnitude slower than for example C/C++/Rust. If your language does math 20-100 times slower than C, it isn't fast from a user perspective. Full stop. It might, however, have a "fast interpreter". Remember, the user doesn't care if it is a fast for an interpreted language, they are just trying to obtain their objective (aka do math as fast as possible). They can get cache locality perfect, and Python would still be very slow (from a math/computation perspective).
andylei · 24 days ago
i'll answer your argument with the initial paragraph you quoted:

> A compiler for C/C++/Rust could turn that kind of expression into three operations: load the value of x, multiply it by two, and then store the result. In Python, however, there is a long list of operations that have to be performed, starting with finding the type of p, calling its __getattribute__() method, through unboxing p.x and 2, to finally boxing the result, which requires memory allocation. None of that is dependent on whether Python is interpreted or not, those steps are required based on the language semantics.

andylei commented on Python performance myths and fairy tales   lwn.net/SubscriberLink/10... · Posted by u/todsacerdoti
nu11ptr · 24 days ago
The primary focus here is good and something I hadn't considered: python memory being so dynamic leads to poor cache locality. Makes sense. I will leave that to others to dig into.

That aside, I was expecting some level of a pedantic argument, and wasn't disappointed by this one:

"A compiler for C/C++/Rust could turn that kind of expression into three operations: load the value of x, multiply it by two, and then store the result. In Python, however, there is a long list of operations that have to be performed, starting with finding the type of p, calling its __getattribute__() method, through unboxing p.x and 2, to finally boxing the result, which requires memory allocation. None of that is dependent on whether Python is interpreted or not, those steps are required based on the language semantics."

The problem with this argument is the user isn't trying to do these things, they are trying to do multiplication, so the fact that the lang. has to do all things things in the end DOES mean it is slow. Why? Because if these things weren't done, the end result could still be achieved. They are pure overhead, for no value in this situation. Iow, if Python had a sufficiently intelligent compiler/JIT, these things could be optimized away (in this use case, but certainly not all). The argument is akin to: "Python isn't slow, it is just doing a lot of work". That might be true, but you can't leave it there. You have to ask if this work has value, and in this case, it does not.

By the same argument, someone could say that any interpreted language that is highly optimized is "fast" because the interpreter itself is optimized. But again, this is the wrong way to think about this. You always have to start by asking "What is the user trying to do? And (in comparison to what is considered a fast language) is it fast to compute?". If the answer is "no", then the language isn't fast, even if it meets the expected objectives. Playing games with things like this is why users get confused on "fast" vs "slow" languages. Slow isn't inherently "bad", but call a spade a spade. In this case, I would say the proper way to talk about this is to say: "It has a fast interpreter". The last word tells any developer with sufficient experience what they need to know (since they understand statically compiled/JIT and interpreted languages are in different speed classes and shouldn't be directly compared for execution speed).

andylei · 24 days ago
The previous paragraph is

> Another "myth" is that Python is slow because it is interpreted; again, there is some truth to that, but interpretation is only a small part of what makes Python slow.

He concedes its slow, he's just saying it's not related to how interpreted it is.

andylei commented on Google cuts mystery check to US in bid to sidestep jury trial   reuters.com/legal/governm... · Posted by u/tildef
ungreased0675 · a year ago
Big companies can just pay money to make antitrust cases go away?!?
andylei · a year ago
case would still happen, just without a jury (maybe)
andylei commented on Intermittent fasting linked to a 91% higher risk of cardiovascular death   eurekalert.org/news-relea... · Posted by u/geox
vlovich123 · a year ago
> “It will also be critical to see a comparison of demographics and baseline characteristics across the groups that were classified into the different time-restricted eating windows – for example, was the group with the shortest time-restricted eating window unique compared to people who followed other eating schedules, in terms of weight, stress, traditional cardiometabolic risk factors or other factors associated with adverse cardiovascular outcomes? This additional information will help to better understand the potential independent contribution of the short time-restricted eating pattern reported in this interesting and provocative abstract.”

So correlation is likely just a data artifact of poor data analysis and nothing to do with intermittent fasting?

andylei · a year ago
No, that's a quote from someone they interviewed who hasn't read the full paper (the full paper is not yet available). They are saying that the details of the study will determine how significant the results are.

> So correlation is likely just a data artifact of poor data analysis and nothing to do with intermittent fasting?

You have no idea whether the data analysis is good or not; the only thing that was released is the abstract.

andylei commented on Bed Bath and Beyond files for bankruptcy   nytimes.com/2023/04/23/bu... · Posted by u/lxm
d136o · 2 years ago
I wonder how much of it is explained by all the company retirement plans that are set to auto invest via an index fund.

They says it’s retail meme stock buyers… but what if it’s everyone who doesn’t have time to look at things and these publicly traded companies are now just selling into those reliable biweekly/monthly retirement account contributions.

andylei · 2 years ago
BBBY is not in any major indices
andylei commented on New York City hiring top rat killer   a002-oom03.nyc.gov/IRM/Ha... · Posted by u/yehudalouis
calculatte · 3 years ago
To be most successful, you need to start with the rats at city hall
andylei · 3 years ago
but also

> Proficiency with Microsoft Word, Excel, PowerPoint

andylei commented on Meta is not threatening to leave Europe   about.fb.com/news/2022/02... · Posted by u/gabea
marksmith2996 · 4 years ago
Yes
andylei · 4 years ago
i mean, then they wouldn't?
andylei commented on Oh, 2022   antipope.org/charlie/blog... · Posted by u/elkos
redisman · 4 years ago
Isn’t that kind of nonsensical reasoning? The viruses evolved how they evolved. I don’t see how the decade they emerged in makes a difference? It didn’t cause a pandemic because of the properties of the virus. Not because of the “decade”
andylei · 4 years ago
> nobody in the 20th century imagined that within just two decades we'd be able to sequence the genome of a new pathogen within days, much less hours, or design a new vaccine within two weeks and have it in human clinical trials a month later
andylei commented on CFTC Orders JPMorgan to Pay Record $920M for Spoofing and Manipulation (2020)   cftc.gov/PressRoom/PressR... · Posted by u/evergrande
maxwelldone · 4 years ago
What's stopping them from charging the people responsible? Are the people so irreplaceable that they are effectively JPM?
andylei commented on Restaurant workers quit at record rate   npr.org/2021/07/20/101608... · Posted by u/boulos
usaar333 · 4 years ago
The covid rule changes to UI were more flexible. You could leave/not take a new job due to covid concerns: https://www.sfchronicle.com/business/networth/article/Califo...
andylei · 4 years ago
but you still can't get unemployment if you voluntarily leave your job

u/andylei

KarmaCake day1818March 10, 2008View Original