News for hackers. Stuff that matters.
Re:Rusty Ownership and the Lifecycle’s Stone by harikb on Sunday November 27, 2022 @12:53PM (#33764916)
Rust fans, when you take a dig at Java or Python, be a bit nice and don't throw numbers without any basis

> Python is two Orders of Magnitude (100x) slower than C. Suddenly, your $3,000 MacBook Pro barely beats an early-1990s-era 386DX computer.

Right under Java logo

> It is not just 60-frames-per-second games that long for high performance. Any CPU-bound or repeated process also requires it

Re:Rusty Ownership and the Lifecycle’s Stone by tln on Sunday November 27, 2022 @01:10PM (#33765081)
I think the Java image should be associated the paragraph before...

> In general, the garbage collector is an inefficient beast.

The article has a tongue-in-cheek style, does the author really need to link to Benchmarks Game and CPU benchmarks?? Modern systems are way more than 100x faster than 386DX anyway.

Re:Rusty Ownership and the Lifecycle’s Stone by klysm on Sunday November 27, 2022 @01:02PM (#33765002)
You should be able to vaguely claim that Python and Java are inherently slower than Rust/C/Whatever. I agree claiming that it is 100x slower is a bit unfounded, but it's pretty easy to go find existing benchmarks that show results like this.
Re:Rusty Ownership and the Lifecycle’s Stone by kapolos on Sunday November 27, 2022 @01:15PM (#33765128)
Yes, it's exactly as you say.

I did search for benchmark comparisons and bumped into one that had 2 orders of magnitude difference.

But naturally, isolated benchmarks can't encapsulate the whole picture because there's a world of difference between testing how fast a loop runs and performance in production.

Re:Rusty Ownership and the Lifecycle’s Stone by codedokode on Sunday November 27, 2022 @01:35PM (#33765295)
I guess that arithmetic operations are not very slow in Python, but if you use objects, then Python performs complicated lookups for every field or method access.
Re:Rusty Ownership and the Lifecycle’s Stone by kaba0 on Monday November 28, 2022 @04:17AM (#33771363)
One is not like the other. Java is much much closer to C/Rust than Python is to Java.
Re:Rusty Ownership and the Lifecycle’s Stone by kapolos on Sunday November 27, 2022 @01:08PM (#33765053)
If I recall correctly, the first time I used Java it was way back in JDK 1.1. It was amazingly slow. Of course, today's Java is fast enough for its domain, but I still enjoy throwing a jab at it here and there :)
Re:Rusty Ownership and the Lifecycle’s Stone by kaba0 on Monday November 28, 2022 @04:20AM (#33771386)
Well, then you are just uninformed. Java can JIT compile hot loops to C speed. There is hardly anything it is not fast enough for, and if there is (a certain kind of HFT), then nor is a general purpose CPU (they use FPGAs).
Re:Rusty Ownership and the Lifecycle’s Stone by pflanze on Sunday November 27, 2022 @03:37PM (#33766650)
Speaking from my observations:

You can't make typical Python programs two orders of magnitude faster by rewriting them in C, but that's because those use many bits that are already implemented in C (data structure implementations, regex engine, I/O, databases etc.).

If however you would rewrite those bits in Python, which is what OP said ("that Python is now the only legal programming language in the world to code with"), things would become two orders of magnitude slower when using the current CPython implementation! A program doing low-level work (e.g. a B-tree implementation) is that much faster when written in C over Python (if you don't cheat and write bits of your Python program in C), assuming that the C program does take advantage of the optimizations that you can do (and typically do) in C. It might be more like a factor of 60, but on a logarithmic scale that's much closer to two magnitudes than one.

This is assuming CPython, not PyPy or one of the subset-of-Python compilers that work more like C.