C++ Raylib VS Python Pygame Speed Comparison in the Game of Life Simulation

  Рет қаралды 4,736

Programming With Nick

Programming With Nick

Күн бұрын

Пікірлер: 25
@RenderingUser
@RenderingUser 7 ай бұрын
Can you make one more comparison with bevy?
@m4rt_
@m4rt_ 8 ай бұрын
This is a really easy question to answer. C++ is way faster. Python is interpreted, so unless you write all the code in native code in a library you call from Python, the performance won't be anywhere close. Also, python being interpreted isn't only making it slow because it has to figure out what to do rune by line every time, but also because it has to do a lot of extra stuff just to do the same. For example, to do a simple add in C++ it takes 1 assembly instruction, while in Python it takes 181 assembly instructions. (Numbers taken from Casey Muratori's Computer Enhance series) Though you could make C++ just as slow, but that would require you to write code that is really slow (for example by heavily using the OOP aspect of C++), and does a lot of unnecessary things.
@jerichaux9219
@jerichaux9219 7 ай бұрын
I honestly doubt that you could even intentionally write C++ to perform as slow as Python. Nothing against Python, it was my first language ever (as it has been for so many), but it has its use-cases and its limitations. Writing a quick-script in Python, leveraging the many available modules written by the community, is often-times a charm compared to writing an equivalent C++ program. But, of course, C++ dominates in terms of performance and control (you can’t get much more close to the metal unless you start raw-dogging assembly), and in my opinion maintainability (even with type-hints, Python can quickly become a mess to manage as it grows in scale). It is, as is so often the case, about choosing the right tool for the job.
@Aserenesnow
@Aserenesnow Ай бұрын
"Your content is highly engaging and informative, I appreciate your efforts. Please continue sharing such valuable resources."
@NatxoVarona
@NatxoVarona 7 ай бұрын
Un gran video NICK y gracias por la comparacion, seguire programando ciertos programas en c++ y otros en Python
@diegoaredes2721
@diegoaredes2721 8 ай бұрын
Wow what difference, nice video.
@AndyFaber
@AndyFaber 7 ай бұрын
Very informative. Thanks a lot!
@siupa23
@siupa23 8 ай бұрын
What about python with raylib ?
@StarFury2
@StarFury2 7 ай бұрын
It wouldn't make a difference. It's not the fault of the graphic library, but core python. As John Carmack said - if you care about performance, you simply can't use 'for' loops in python. Excellent modules like Numpy or JITs can provide workarounds, but you'll constantly pay hefty performance toll for initial ease of use of Python.
@정하은-h6s
@정하은-h6s 7 ай бұрын
Great video Nick!
@GabrielBigardi
@GabrielBigardi 7 ай бұрын
Please make a comparison with Bevy as others suggested, it will be really interesting.
@mrdixioner
@mrdixioner 7 ай бұрын
I'm wondering why the Python developers made this language so slow? What prevented them from making it an order of magnitude faster? Python could be divided into two possibilities: compiled (for fast and demanding tasks) and interpreted (for scripts, WEB and other development). Regarding the comparison: I would like to know the difference in performance between C++ and C#.
@rondeau_choysky6663
@rondeau_choysky6663 7 ай бұрын
Interesting. It would be good to know the ram comsumption. I am making a visual novel with SDL c++ and I am wondering if it is better to use renpy
@RenderingUser
@RenderingUser 7 ай бұрын
I think renpy will be better for basically every reason. Python isn't slow when it comes to something as simple as a visual novel. Renpy also comes built in with useful visual novel features like save files and resource handling and the ability to export easily to all platforms. I don't think you need a compiled language for a visual novel.
@diegoaredes2721
@diegoaredes2721 7 ай бұрын
@@RenderingUser i agree.
@alessandrorossi1294
@alessandrorossi1294 6 ай бұрын
Why C++ and raylib vs Python and Pygame? Why not C++ and raylib vs Python and raylib?
@AndyFaber
@AndyFaber 7 ай бұрын
Btw, have you thought about a raylib game tutorial for a 2-player game equipped with an AI player, like Tic-tac-toe with the minimax algorithm for training the AI?
@SebastianHasch
@SebastianHasch 7 ай бұрын
You don't even need an AI that sophisticated for tic-tac-toe. There is an optimal way to play where you never lose. If that's too boring just let it make random moves 30% of the time ;)
@AndyFaber
@AndyFaber 7 ай бұрын
Sure, but the idea was rather to focus on a simple game AI based on tree algorithms. Tic-tac-toe is indeed too simple. On the other hand, many known games are really complex and overkill for a tutorial. I don't know about Othello, though. Maybe it's a good example if the board isn't too big.
@SebastianHasch
@SebastianHasch 7 ай бұрын
@@AndyFaber True. I guess in this case tic tac toe really is the best option👍
@AKG58Z
@AKG58Z 29 күн бұрын
Same video with different game i have seen it already and it's good
@Carube
@Carube 7 ай бұрын
c++ vs c vs rust game fps please
@youssefabsi6296
@youssefabsi6296 11 күн бұрын
try it with julia
@gammyhorse
@gammyhorse 3 ай бұрын
Free Pascal is faster 😎
Convert GIF to Sprite Sheet using Python and learn the Pillow module.
15:38
Programming With Nick
Рет қаралды 2,2 М.
Stop using these wrong.
4:37
Nathan Baggs
Рет қаралды 10 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 6 МЛН
Мама у нас строгая
00:20
VAVAN
Рет қаралды 12 МЛН
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 32 МЛН
Create Life From a Simple Rule
14:37
Brainxyz
Рет қаралды 788 М.
Harder Than It Seems? 5 Minute Timer in C++
20:10
The Cherno
Рет қаралды 221 М.
Compiled Python is FAST
12:57
Doug Mercer
Рет қаралды 117 М.
Pygame vs Raylib vs Arcade Pyglet: Which One Will Suprise You?
14:17
Python is 71x Slower, Uses 75x More Energy, Than C
23:29
Bryan Lunduke
Рет қаралды 34 М.
Pygame's Performance - What You Need to Know
9:11
DaFluffyPotato
Рет қаралды 208 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 152 М.
Compile C/C++ raylib game Into WebAssembly
16:07
Programming With Nick
Рет қаралды 20 М.
Where is Rust being used?
11:46
Let's Get Rusty
Рет қаралды 129 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 49 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 6 МЛН