Python vs C/C++ vs Assembly side-by-side comparison

preview_player
Показать описание
next i will compare fortran and 4chan

a test of the relative performance, not the prime-checking algorithm
Рекомендации по теме
Комментарии
Автор

stop cyberbullying me over python semicolons. it's a coping mechanism

xmdi
Автор

"Use ASM if you are paid hourly"
That's such a genius trick

arkfish
Автор

In my company, we have a C program which takes three hours to load some data to a database. A modern Java program has been written to replace it. That takes six hours.

richardfarrer
Автор

Don't forget that..
• Python is an interpreted programming language.
• C and C++ are compiled languages which get optimized during compilation
• Assembly is just sequence of instructions labeled with names typeable on a Latin keyboard. It isn't optimized or whatever.

As long as it gets the job done 👍
C/C++ was the winner, but there are contexts where Python or Assembly would be a better tool for the job :)

apricotapple
Автор

One thing thats interesting about assembly vs high level languages is that back when high level languages were new, there was a similar sentiment about compiled languages as there is now with interpreted languages. The whole idea that compiled languages were so slow and unskilled. But now compiled has taken over since its way better optimized and allows for really complex programs to be way simpler. Maybe the same will happen for interpreted languages

jhawley
Автор

Python users: Just use a package for that!
C/C++ users: Who do you think made the package?
C/C++ users: BTW you should compile with -O3, the compiler knows everything!
ASM users: Who do you think made the compiler?

Tumbolisu
Автор

I use python to generate lookup tables and the sort of preprocessing that is done once, because slapping something together in python is fast and intuitive. Everything else I do is C/C++ (I play around with embedded stuff).

akkudakkupl
Автор

This comparison is for fun. Thanks for this. The important is what is your purpose.

tienson
Автор

"Use ASM if you are paid hourly" 😂

shizuka.yashiro
Автор

Kind of surprised that nobody mentioned this, but when people talk about "Python saves development time", they don't mean the time that it takes you to type out an algorithm, that you already know ahead of time. Like, this is really obvious. "Development time" includes everything from "Let's start thinking about how I would solve this problem" and until "The program is written, documented, tested, packaged and ready to be shipped to production". Also, development time includes "Oh, I'll just use this library" vs "Oh, let's go implement a B-Tree in ASM".

ruroruro
Автор

what is that sys time difference? does that mean that assembly is faster than C by at least 2 thirds for the system? and how much space, in percent, does the same c program take when written in assembly?

spektra
Автор

What will happen if you write in x86 ASM but later asked to run on ARM instead? Double the pay? Since paid hourly ?

Noobisnoob
Автор

now do a Assembly vs Punching cards side-by-side comparasion

commandprompt
Автор

Everyone is forgetting that his code has the same form for all 3 languages. Yes there is better ways to do it in python but same goes for c and c++. Python is slower its just a fact doesn't mean its useless. All the man did was test code of O(n^2) in 3 languages to see witch runs faster. And how long it takes to develop it.

mrfluffy
Автор

It just shows the power of the languages designed to be fast vs the one designed for ease of use/learning automation etc (plus it has numpy etc from the past languages, so there's really the best of both worlds)

HirschyKiss
Автор

Once upon a time, when the first extended instructions (MMX, etc.) first came out, and C/C++ compilers were still being optimized, it did make sense to go with hardcoded x86 assembly if you needed the bleeding edge performance. I've maintained embedded systems written entirely in x86 (technically 286) assembly because at the time that was the only way to get the necessary performance (at least, without going with a 68k instead :/).

But nowadays? C/C++ compilers (yes, even GCC/MSVC) are going to extract more performance then anything you will ever write. Let them do their job.

gamerk
Автор

python semicolons, you're on another level

rodricbr
Автор

It's interesting to see a similar review for languages Python, JavaScript, Delphi

devsergo
Автор

Whats the main differences between LC3 assmebly and x86 assembly?

wesleybrooks
Автор

why check from 2 to n/2? you only need to check from 2 to sqrt(n) for prime numbers - you can implement this by doing "while i*i <= n"

CAG