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

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

Programming With Nick

Programming With Nick

Күн бұрын

Пікірлер: 22
@m4rt_
@m4rt_ 5 ай бұрын
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 5 ай бұрын
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.
@RenderingUser
@RenderingUser 5 ай бұрын
Can you make one more comparison with bevy?
@NatxoVarona
@NatxoVarona 5 ай бұрын
Un gran video NICK y gracias por la comparacion, seguire programando ciertos programas en c++ y otros en Python
@AndyFaber
@AndyFaber 5 ай бұрын
Very informative. Thanks a lot!
@alessandrorossi1294
@alessandrorossi1294 3 ай бұрын
Why C++ and raylib vs Python and Pygame? Why not C++ and raylib vs Python and raylib?
@diegoaredes2721
@diegoaredes2721 5 ай бұрын
Wow what difference, nice video.
@정하은-h6s
@정하은-h6s 5 ай бұрын
Great video Nick!
@mrdixioner
@mrdixioner 5 ай бұрын
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#.
@GabrielBigardi
@GabrielBigardi 5 ай бұрын
Please make a comparison with Bevy as others suggested, it will be really interesting.
@rondeau_choysky6663
@rondeau_choysky6663 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
@@RenderingUser i agree.
@siupa23
@siupa23 5 ай бұрын
What about python with raylib ?
@StarFury2
@StarFury2 5 ай бұрын
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.
@AndyFaber
@AndyFaber 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
@@AndyFaber True. I guess in this case tic tac toe really is the best option👍
@Carube
@Carube 5 ай бұрын
c++ vs c vs rust game fps please
@gammyhorse
@gammyhorse Ай бұрын
Free Pascal is faster 😎
Convert GIF to Sprite Sheet using Python and learn the Pillow module.
15:38
Programming With Nick
Рет қаралды 2 М.
Conway's Game of Life tutorial in C++ & raylib - OOP
1:11:06
Programming With Nick
Рет қаралды 10 М.
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 44 МЛН
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 6 МЛН
Python Simulation Tutorial - Conway's Game of Life
41:13
Tech With Tim
Рет қаралды 34 М.
Compile C/C++ raylib game Into WebAssembly
16:07
Programming With Nick
Рет қаралды 17 М.
Compiled Python is FAST
12:57
Doug Mercer
Рет қаралды 110 М.
6. Создаем игру "Тетрис" на Python используя библиотеку Pygame #python #pygame #игразмейка
24:11
ITMouse: международная школа программирования
Рет қаралды 335
I Rewrote This Entire Main File // Code Review
16:08
The Cherno
Рет қаралды 159 М.
Pygame vs Raylib vs Arcade Pyglet: Which One Will Suprise You?
14:17
Coding Challenge #85: The Game of Life
38:20
The Coding Train
Рет қаралды 686 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 785 М.
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Coding With Russ
Рет қаралды 922 М.
Get Started in pygame in 20 minutes!
21:56
Programming With Nick
Рет қаралды 1,5 М.
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 44 МЛН