Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Slower than C... I think this depends more upon your algorithm and whether or not you push the python interpreter to call the internal functions correctly. If you don't program idiomatic python it will be really slow. Also, python does have JIT interpreters available. There are also modules that allow you to decorate a function that will be compiled to machine code. Then there is opencl and opencv libraries.
Also, programmer time is often more important than execution speed. Especially for quick one off scripts. -
Cool trick, OP ;)
@Demolishun blah blah blah
Python is slower than C and will always be, even with compilers like numba.
But yeah, it has its uses -
Oh well nice 😂
While that's true, it's not important in your use case.
I mean it's more convenient to just whip up something on Python CLI than write and compile a full C program. -
@MagicSowap You understand the JIT interpreters have the potential to be faster than compiled code right? I believe the V8 can use runtime metrics and information to further optimize the machine code it produces. This information it not available to a traditional compiler.
-
@Demolishun Just no.
Also, ever heard about Profile Guided Optimization (PGO) (also called FGO) ?
(gcc -fprofile-use & gcc -fauto-profile)
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
elgringo41Student - Teacher renaming .c to .exe make the program executable ? Teacher - Yes A group of people stand up...
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
I always used Python as a CLI calculator. "But Python is an interpreted language and therefore slower than C". Me:
rant
c++
c
gdb
math
python