Deutsch English Français Italiano |
<v8d6dd$1idgc$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: "Python is 71x Slower, Uses 75x More Energy, Than C" - YouTube Date: Wed, 31 Jul 2024 12:15:58 +0100 Organization: A noiseless patient Spider Lines: 44 Message-ID: <v8d6dd$1idgc$1@dont-email.me> References: <v8bv5k$18i9h$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 31 Jul 2024 13:15:58 +0200 (CEST) Injection-Info: dont-email.me; posting-host="347b83598d1f9579c61ddef4ed8d87f6"; logging-data="1652236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wDxgQ4kmkuJor1jtggLyp" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:iLF1DhbfcAujy9v9Wn7obIKt+qs= Content-Language: en-GB In-Reply-To: <v8bv5k$18i9h$2@dont-email.me> Bytes: 2708 On 31/07/2024 01:06, Lynn McGuire wrote: > "Python is 71x Slower, Uses 75x More Energy, Than C" - YouTube > https://www.youtube.com/watch?v=U4c6nFGt1iM Could that guy's voice be any more annoying? Anyway, some observations: * CPython (I assume this is Cpython), is of course just a program written in C. So it's really just a C application ... * The C results are going to be mostly thanks to the efforts of aggressively optimising compilers, rather than the language itself. I guess they weren't using Tiny C! * The test programs are all from the computer language benchmarks game, which are mostly useless for comparisons. Because entries can choose their own algorithms, employ multi-threading etc. So it's no surprise there is such a wide range of results. * When Python is used for a one-off program that runs in a fraction of a second, the fact that is is 70 times slower than the C equivalent is irrelevant. But if you include the build-time for the C, then the Python may well have used fewer machine resources. > > I am not buying that C++ is slower than Rust. > > The referenced paper is: > https://www.sciencedirect.com/science/article/abs/pii/S0167642321000022 > It's the computer benchmarks game; I wouldn't pay too much attention. When I once tested of its programs ('fannkuch') I got these results, although they are several years old (3 out of 24 shown): Clang -O3 2.45 secs Rustc -O 3.2 Tiny C 10.1 Rustc 37.8 Rust in debug mode ran a magnitude slower than optimised releae mode. Maybe it was interpreted? I never found out why.