How to OPTIMIZE YOUR CODE!

Use code #cherno and try out PVS Studio for free ► pvs-studio.com/cherno_pvs
Check out PVS Studio's KZread channel ► bit.ly/PVSKZread
Patreon ► / thecherno
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► / discord
Optick ► github.com/bombomby/optick
Chapters
---------------
0:00 - Optimizing Performance
2:30 - Finding slow code
4:53 - The importance of hardware
7:24 - CPU vs GPU
9:01 - Compilers and settings
9:44 - Timers
11:14 - Profiling with Optick
13:18 - PVS Studio for optimization
14:39 - Next steps to optimize
This video is sponsored by PVS Studio.

Пікірлер: 167

  • @TheCherno
    @TheCherno2 жыл бұрын

    Hope y'all enjoyed the video! ❤️ What's your favourite strategy to optimize your code?

  • @yerngames

    @yerngames

    2 жыл бұрын

    Make sure it works first is the best way to do it 😂

  • @oamioxmocliox8082

    @oamioxmocliox8082

    2 жыл бұрын

    ;)

  • @vonatok

    @vonatok

    2 жыл бұрын

    compiler switch /O2

  • @literallynull

    @literallynull

    2 жыл бұрын

    What do I use? inline keyword , use as small class/struct fields as possible, shitton of ^=,&=, |=, operators, r-value references(for move semantics purposes only)... these guys are actually the 4 hourseman of a terrible programmer(I consider myself as one of them), just don't use them, pretend they do not even exist or smth.

  • @user-mt2uh1ow7d

    @user-mt2uh1ow7d

    2 жыл бұрын

    @@literallynull just make sure theres more nullptrs

  • @SkullCloud11
    @SkullCloud112 жыл бұрын

    Easy steps to make code run faster: 1) Don't trust compiler 2) write your own assembly 3) Don't trust OS 4) Write your own OS 5) Don't trust processor's BPU and OoOE 6) roll your own processor 7) redefine the universe 8)

  • @MatsorBrowncoat

    @MatsorBrowncoat

    2 жыл бұрын

    Isn't this Apple's journey to a T?

  • @SkullCloud11

    @SkullCloud11

    2 жыл бұрын

    @@MatsorBrowncoat wait I just realized -

  • @endyx2708

    @endyx2708

    2 жыл бұрын

    8) is the new octave of existence

  • @juanma_cello

    @juanma_cello

    2 жыл бұрын

    8) Don’t trust computer science 9) Redefine computer science itself

  • @kv6257

    @kv6257

    2 жыл бұрын

    8) redifine code

  • @artemisDev
    @artemisDev2 жыл бұрын

    Optmization is easy, just give your customers a top tier pc.

  • @CasperA

    @CasperA

    2 жыл бұрын

    The only way.

  • @VivekYadav-ds8oz

    @VivekYadav-ds8oz

    2 жыл бұрын

    Ngl, a subscription model, or consoles-as-a-service where I can get consoles for certain parts of the year (holidays) will be a blessing. Can fill a certain niche.

  • @literallynull

    @literallynull

    2 жыл бұрын

    Laughs in Yandere Dev

  • @techzone913

    @techzone913

    2 жыл бұрын

    Yeah its was easy until it become challenge to older hardware and that problematic

  • @karlchiasson4946

    @karlchiasson4946

    2 жыл бұрын

    So you have chosen brute force.

  • @nathanlloyd774
    @nathanlloyd7742 жыл бұрын

    Empty files usually execute faster than files that contain anything written by me

  • @sangamo38
    @sangamo382 жыл бұрын

    My key strategy for optimization is : 1. Try not to use too much library functions without knowing what they do, most of the time a lot of functions have a lot of build up behind the scenes which in a larger application could affect the performance.. 2. C is the fastest so try to write code in such a way that resembles more towards c style for example if you get away with using an array for hashing instead of map then do it. It will greatly improve performance. 3. I/O operations are your enemy, so you want to avoid as much as I/O possible. 4. Avoid logical impurities like too much branching and recursion. Use guard clauses, bitwise operations and optimal algorithms. 5. Try to use availability of infinite memory to speed up calculations. memoizing calculations that you doing again and again can help greatly improve.

  • @xeridea
    @xeridea2 жыл бұрын

    Using 1 thread on a quad core is like driving a car with 3 dead cylinders.

  • @bluesillybeard

    @bluesillybeard

    2 жыл бұрын

    that is a really good analogy

  • @benedani9580

    @benedani9580

    2 жыл бұрын

    Using 1 thread on a multi core is like typing with 1 finger.

  • @xeridea

    @xeridea

    2 жыл бұрын

    @@benedani9580 I had a high school teacher who typed with one hand without looking.

  • @Warwipf

    @Warwipf

    2 жыл бұрын

    @SomeoneRandom Typing with two hands without looking is easy, everyone does that. Writing with just one hand without looking is pretty impressive lol

  • @Dustyy01
    @Dustyy012 жыл бұрын

    Best intro ever 😂

  • @oamioxmocliox8082

    @oamioxmocliox8082

    2 жыл бұрын

    ;)

  • @Codepeats

    @Codepeats

    2 жыл бұрын

    👍👌

  • @GreenSkyGaming

    @GreenSkyGaming

    2 жыл бұрын

    Mein Keks QwQ

  • @Dustyy01

    @Dustyy01

    2 жыл бұрын

    @@GreenSkyGaming nee

  • @Mampinator
    @Mampinator2 жыл бұрын

    I found your channel in my recommendations today and I really like all of the devlogs for Hazel. I love the physics demos and the editor ui a lot.

  • @Zvend

    @Zvend

    2 жыл бұрын

    welcome to the best C++ Community

  • @TheExstud
    @TheExstud2 жыл бұрын

    One thing I personally do is prototype in C#, then compare performance with C++. I'm happy when I beat C# by 10-20%, the initial C++ code is often tens to hundreds times slower.Using a custom memorypool is also a good idea to boost performance, if you're doing a lot of memory allocations.It would be great if you could make a video on how to actually make your code faster, not just profile it.

  • @user-py9cy1sy9u

    @user-py9cy1sy9u

    2 жыл бұрын

    Pay attention to how you use the memory. Unless you are writing a simulation then memory usage(bandwith, cache) is the big problem. I found talks by Mike Acton to be useful. Thats the best I can do in youtube comment

  • @TheExstud

    @TheExstud

    2 жыл бұрын

    @@user-py9cy1sy9u I know about cache lines, thanks, it's indeed important to read from the same chunk (64 bytes on most systems) of memory whenever you can, and to align everything properly. This is one of the things I'd like to see in another Cherno video.

  • @jerrody5400
    @jerrody54002 жыл бұрын

    Родненькие наши ковры, прям настроение поднимает.

  • @iDROIDchannel

    @iDROIDchannel

    2 жыл бұрын

    Жаль не на стене

  • @ariesduke2047

    @ariesduke2047

    2 жыл бұрын

    ахах даже не заметил

  • @VivekYadav-ds8oz

    @VivekYadav-ds8oz

    2 жыл бұрын

    For those on desktop -> Comment: Our dear carpets, straight up the hood. 1st reply: Sorry not on the wall 2nd reply: ahah didn't even notice. (Google translated but I still have no idea what they're talking about).

  • @prateekkarn9277

    @prateekkarn9277

    2 жыл бұрын

    @@VivekYadav-ds8oz I read this exact thing on mobile translated by Google and even I don't understand wtf is going on

  • @Olegach21

    @Olegach21

    2 жыл бұрын

    @@prateekkarn9277 the carpet from the beginning of the video is the type that was very popular in ex USSR. It's also was used as an ad hoc sound insulation, by hanging it on the wall. There's also a meme that every Russian has a picture of themselves and a carpet on the wall as a background.

  • @williamclifford657
    @williamclifford6572 жыл бұрын

    Really enjoyed the video today. Was only teaching some students about service level agreements and measuring system performance the other day. I'm glad the use of your own performance checks with timers hasn't become totally obsolete. Would be really interested to hear more from you on opengl performance/timers.

  • @Beatsbasteln
    @Beatsbasteln2 жыл бұрын

    my projects weren't nearly as big as hazle yet but until now i was always able to tell which methods take the longest by just looking at them. sometimes i deliberately write non-performant code, because it's more readable and i just wanna get stuff done, but then i leave a comment so i remember to improve it later when i need the power, and ofc when i actually wanna finish the thing

  • @nikolaiarsenov1595
    @nikolaiarsenov15952 жыл бұрын

    I love the format of that video!

  • @nathanosullivan2296
    @nathanosullivan22962 жыл бұрын

    Your videos have become so high quality over the years

  • @gommito
    @gommito2 жыл бұрын

    Great video! I wonder if you implemented some custom allocator. I've heard it can really speed things up. Good luck!

  • @patryk_49
    @patryk_492 жыл бұрын

    Casey Muratori recently uploaded an excellent video series on optimizations.

  • @brandonsamuelcruzsilva7626
    @brandonsamuelcruzsilva76263 ай бұрын

    Thank you for sharing your expertise!!!

  • @codecodecode3988
    @codecodecode39882 жыл бұрын

    when it comes to optimizing i think of the optimizations and the techneks available before writing code; and c and DOD are what i like

  • @mistermcking8445
    @mistermcking84452 жыл бұрын

    Great video mate!

  • @ItsMePhoebe
    @ItsMePhoebe2 жыл бұрын

    I've been wanting to learn this for ages! Cant wait to watch this later on! Thanks in advance! :)

  • @ashraionart
    @ashraionart2 жыл бұрын

    Love to see ur journey...

  • @MrHaggyy
    @MrHaggyy Жыл бұрын

    Writing a timer that tracks a frame and sub timestamps are soo usefull. Timer, number of calls and memory footprint are so basic you should always track them. Makes pro and cons about code measurable.

  • @mohammednihad6755
    @mohammednihad67552 жыл бұрын

    I feel something is different about this episode, IDK what is it, but I love it!

  • @drip7547
    @drip75472 жыл бұрын

    imo the "Producing Wrong Data Without Doing Anything Obviously Wrong" paper is also something that pretty interesting to read through if you REALLY really care :>

  • @wChris_
    @wChris_2 жыл бұрын

    So i have seen Molly Rockets video about non-pessimization (The Refterm Lecture), and in there he explains that in order to optimize something, you have to write code that isnt pessimized, or in other words you have to write the code that does the minimum amount of work you need to do. For example: dont write an OS if all you need to do is print something to the screen! Or using a library that does extra stuff you DONT need or not even knowing WHAT a library does.

  • @DaveChurchill
    @DaveChurchill2 жыл бұрын

    Optick crashes whenever I try to load a JSON that was produced using the syntax you stated during your chrome tracing video. Any idea why this is?

  • @kimfom
    @kimfom2 жыл бұрын

    Thank you for sharing

  • @heatblazer
    @heatblazer2 жыл бұрын

    Usually RW is the bottleneck - less OOP more DOD , less abstractions more cache coherency - simple.

  • @LimboTheory
    @LimboTheory2 жыл бұрын

    I've been watching so much rp content after my break up and now KZread recommended me to you again. KZread said it's time

  • @Spacemarine658
    @Spacemarine6582 жыл бұрын

    I used optimization October to optimize myself and my work flow

  • @multi2176
    @multi21762 жыл бұрын

    Cannot wait for the multi-threading video.

  • @mr.anderson5077
    @mr.anderson50772 жыл бұрын

    Thanks sensei

  • @lotusfish8632
    @lotusfish86322 жыл бұрын

    looking forward to next month: optimisation october 2

  • @salockingaming6246
    @salockingaming62462 жыл бұрын

    hey, do you play guitar? and if so have you ever made a video playing, I always see them in the background

  • @badwolf8112
    @badwolf81122 жыл бұрын

    Been wondering about how do we know that improvements by using profiling effects systems with different hardware than the PC the profiler runs on.

  • @user-py9cy1sy9u

    @user-py9cy1sy9u

    2 жыл бұрын

    Wait till you read "Producing Wrong Data Without Doing Anything Obviously Wrong!" :D

  • @MrJCraft
    @MrJCraft2 жыл бұрын

    for optimization of my recent projects, I needed to switch languages yes trying to calculate millions of verts is really slow in python. basically all I found out down that route is just make sure its compiles and designed for speed, because different languages and compilers have different optimizations that can save a lot of time, its surprising how big of a difference a good compiler can make. especially for a relative beginner at optimizing. most of my code never needed it until now. maybe in the future I might try optimizing with assembly its way more natural for me to think of bytes though, so I might be able to make better optimizations. but I have been doing boolean algebra for a while.

  • @patrikjankovics2113

    @patrikjankovics2113

    2 жыл бұрын

    Optimizing with ASM is usually worse than writing optimized C++ code, at least in MSVC's case, because you hurt the optimizer's feelings and he just wont optimize the code as well. (Jokes aside, really, the optimizer won't work that well with inline ASM)

  • @hitlerssecondcoming2523
    @hitlerssecondcoming25232 жыл бұрын

    Going to be useful for my simulations in rust as well, thanks!

  • @1schwererziehbar1

    @1schwererziehbar1

    2 жыл бұрын

    If you use Rust, your optimizations should focus on compilation speed.

  • @ShivamJha00

    @ShivamJha00

    2 жыл бұрын

    @@1schwererziehbar1 c++ isn't much better in that regard either

  • @beaumanVienna
    @beaumanVienna2 жыл бұрын

    Are you guys doing the model view projection entirely on the GPU? I use batch rendering and a single uniform, so I have to do the model transformation on the CPU. How to optimize this?

  • @yasserarguelles6117

    @yasserarguelles6117

    2 жыл бұрын

    It's probably better to have the model transformations on the CPU since it's going to be done per vertex shader call on the GPU vs per instance on the CPU, i recommend testing to see if there's even an issue first

  • @galaxian_hitchhiker
    @galaxian_hitchhiker2 жыл бұрын

    Be a true scientist and calculate/compare your performance results, evaluate data correctly, before and after optimization!!!

  • @CreativeOven
    @CreativeOven2 жыл бұрын

    polishing and optimization not for me... no ... but it has to be done! thanks to share your knowledge

  • @timothyvandyke9511
    @timothyvandyke95112 жыл бұрын

    Hey Cherno, do you know anything about how to make a dynamic programming problem multi threaded? For my job I made a school scheduler. Each student's schedule is obviously dependent on itself as it goes AND the previous schedules. Does that mean multi-threading my app is impossible? When I reach 215 students it takes 10 seconds while single threaded. I do way more sorting than I need so I know I have some low hanging fruit but also I wondered if there were larger things I could do

  • @timothyvandyke9511

    @timothyvandyke9511

    2 жыл бұрын

    Not game programming at all, and it's in C#

  • @Mugistan
    @Mugistan2 жыл бұрын

    No bug November

  • @ymi_yugy3133
    @ymi_yugy31332 жыл бұрын

    I find that my most common issue is using inefficient, naive algorithms.

  • @Haellsigh
    @Haellsigh2 жыл бұрын

    Optick is great, but Tracy is even better, at least for my use case.

  • @LuccasSchmigel
    @LuccasSchmigel2 жыл бұрын

    Best intro sir. haha

  • @thepretendgineer2288
    @thepretendgineer22882 жыл бұрын

    haha that intro just makes me think of studio wildcards optimisation technique

  • @ThankYouESM
    @ThankYouESM2 жыл бұрын

    Much as I very much love Python and can get it to randomly generate various styles of artwork... it processes way to slow for me. I can't figure out the numpy for it either. Would be awesome if we can also choose which variables to assign so we can get the speed needed from every CPU and especially the GPU as desired. However... I haven't tried out Godot yet.

  • @TheRyulord

    @TheRyulord

    2 жыл бұрын

    If you haven't heard of it already, you might want to check out JAX. It's basically NumPy but with a JIT compiler and (Nvidia) GPU support.

  • @ThankYouESM

    @ThankYouESM

    2 жыл бұрын

    @@TheRyulord Thank You

  • @edubogota1
    @edubogota12 жыл бұрын

    Cherno can we do a recation video of the latest Halo infinite gameplkay trailer? It has improvements. Thank you!

  • @billynugget7102
    @billynugget71022 жыл бұрын

    Associated memory… cherno bout to hit us with DOD straight facts

  • @falxie_
    @falxie_2 жыл бұрын

    Hazel is looking good

  • @CreativeOven
    @CreativeOven2 жыл бұрын

    In ue4 take care of the construct function/event/whatever very fast construct instructions! is just one...

  • @MrBOB-hj8jq
    @MrBOB-hj8jq2 жыл бұрын

    I have the same big ben tea box.

  • @kalempster
    @kalempster2 жыл бұрын

    Optimization november incoming

  • @HonsHon
    @HonsHon2 жыл бұрын

    Love your videos. Also, you typically look really sad in the thumbnails everything alright?

  • @pastasawce
    @pastasawce2 жыл бұрын

    How did u both get such strong aussie accents?

  • @yasserarguelles6117

    @yasserarguelles6117

    2 жыл бұрын

    He probably spawned in Australia

  • @anton_98
    @anton_98 Жыл бұрын

    "You really write them (tools) into your own application, they can't be wrong" Just hilarious)))

  • @AgentM124
    @AgentM1242 жыл бұрын

    Welcome to No-optimization November.

  • @vyteniskajackas7579
    @vyteniskajackas75792 жыл бұрын

    Maybe not much of an optimization, but why people write i++ and complete ignore ++i? In 80-90% cases you should be writting ++i, since i++ does extra steps and therefore could lower the performance. It may seem like a detail, but when it is done thousand times, code may be slower, than it could be. Ofcourse, black magic powered compilers probobly fix this for you and makes it ++i where it can be done. Maybe its a small thing, but I believe its a good practise that is not talked about.

  • @TheCherno

    @TheCherno

    2 жыл бұрын

    It's not really talked about because for the use cases you're talking about (single expression statements like in a for loop) there is no difference in generated code in bsaically all compilers. Here's an example: godbolt.org/z/s4b7WeWch

  • @yohwllo2127
    @yohwllo21272 жыл бұрын

    I have another problem, my code is too fast

  • @michalrabek7743
    @michalrabek77432 жыл бұрын

    0:02 Building a computer on a rug without ESD protection should be viewed as an extreme sport. 😂 The intro was great though! 👌

  • @1schwererziehbar1

    @1schwererziehbar1

    2 жыл бұрын

    I've never used ESD protection in my life and never had any problems. Most modern PC parts can be blasted with a tesla coil and will still work.

  • @michalrabek7743

    @michalrabek7743

    2 жыл бұрын

    @@1schwererziehbar1 I know that not using ESD protection won't blow up your components instantly, but it CAN happen. Honestly, whether or not you use ESD protection for your personal build is totally your thing 👍. However when I build/fix a PC for someone else, I use ESD protection 100% of the time for the sake of not accidentally breaking their stuff just by being careless. But yeah, not using it for your own home rig is fine, I guess 🤷, although it's still a bit risky. Better safe than sorry and saying sorry to someone for bricking their fancy mobo can be a bit difficult 😅

  • @xeridea

    @xeridea

    2 жыл бұрын

    @@michalrabek7743 If you touch the case first to discharge any built up potential, and don't rub all over the carpet, you should be fine. Similarly, it is good to touch your car first when refueling. Using this basic step virtually eliminates chance of ESD. Using protection isn't a bad idea of course, but I wouldn't stress over it.

  • @michalrabek7743

    @michalrabek7743

    2 жыл бұрын

    @@xeridea Yep, you're right. Touching a grounded surface works as well.

  • @mastershooter64

    @mastershooter64

    2 жыл бұрын

    @@1schwererziehbar1 Not using ESD protection while building PCs is like not wearing a seat belt while driving a car, sure you could survive crashes without a seat belt but would you really wanna risk it?

  • @LordOfWizardurl
    @LordOfWizardurl2 жыл бұрын

    Will you convert hazel to GNU/Linux support?

  • @pxolqopt3597

    @pxolqopt3597

    2 жыл бұрын

    I'd just like to interject for a moment. What you’re referring to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.

  • @lucass8119

    @lucass8119

    2 жыл бұрын

    @@pxolqopt3597 They already said GNU/Linux and their comment isn't edited... this is a little embarrassing.

  • @pxolqopt3597

    @pxolqopt3597

    2 жыл бұрын

    @@lucass8119 i put that in as a joke because they said GNU/Linux

  • @PirateKnO
    @PirateKnO2 жыл бұрын

    Optimization october starts at october 30th 😂

  • @avtem
    @avtem2 жыл бұрын

    i had a few little 3d games that were using 100%cpu all the time. So i just uninstalled all of them, because it's impossible to play.

  • @LiraeNoir
    @LiraeNoir2 жыл бұрын

    Ugh 24fps... that works in film because projectors are 24fps, insert black between them, and because camera have a shutter meaning they have blur on every single moving part. And even then, camera operators have strict rules about the speed of their pans for example to avoid framerate issues. 24fps in a videogame is just not a pleasant experience to play, at all. 30+ is ok under certain conditions. Under 16ms of frametime is really the reasonable bare minimum nowadays, and under 8ms for fast games.

  • @xeridea

    @xeridea

    2 жыл бұрын

    24FPS works better in video because it is consistent. Games framerates can have a lot of variance. If running average 30FPS, you are likely to have a few frames that would take longer, perhaps twice as long. So to get consistent minimum 30FPS, 60FPS average is desirable. Some years ago, reviewers started including 1% and 0.1% lows, as well as frame time graphs to highlight temporary slowdowns due to drivers, poor game code, slow CPU, overloaded hardware, etc. Some games, particularly first person shooters, or competitive E-Sports games benefit from faster framerate, and casual games can be fine as long as it's smooth.

  • @Jkauppa
    @Jkauppa2 жыл бұрын

    we have infinite time, no rush

  • @katie-ampersand
    @katie-ampersand2 жыл бұрын

    optimization is easy just set the fps to a higher number

  • @bradenbigham2487
    @bradenbigham24872 жыл бұрын

    except when you try to fix code in one part...other parts break!!!!

  • @jesterflint9404
    @jesterflint94042 жыл бұрын

    This month is Optimization October That means next month is No Nut November???

  • @StevenMartinGuitar
    @StevenMartinGuitar2 жыл бұрын

    How to optimise your code... Use some tools and spread the GPU/CPU load. Although I enjoyed the video I was hoping to learn the basics of the specifics. As someone who hasn't optimised any code before, I didn't really take anything I can use from this. Not hating, still one of my favourite channels and greatful.

  • @sandeeprao9527
    @sandeeprao95272 жыл бұрын

    gRPC C++ Video Please!!

  • @miloverreijt6396
    @miloverreijt63962 жыл бұрын

    It's easy, just press ctrl+A delete

  • @timothyjohnson4470
    @timothyjohnson44702 жыл бұрын

    Unfortunately, I cannot watch this video, there is no subtitle for English. I'm deaf and feel left out of this awesome content

  • @evan_game_dev
    @evan_game_dev2 жыл бұрын

    Yeah, I do a different kind of optimization. No optimization

  • @nicobugs
    @nicobugs2 жыл бұрын

    Just so you know, your intro is what made me click on the video.

  • @LordOfWizardurl
    @LordOfWizardurl2 жыл бұрын

    Lol

  • @LittleRainGames
    @LittleRainGames2 жыл бұрын

    The best way to easily optimize code is to make variables 1 letter and remove comments.

  • @oamioxmocliox8082
    @oamioxmocliox80822 жыл бұрын

    ;)

  • @WhozZzWho
    @WhozZzWho2 жыл бұрын

    Lol New World

  • @Dartht33bagger
    @Dartht33bagger2 жыл бұрын

    -O3

  • @shawn576
    @shawn5762 жыл бұрын

    The game might freeze? Solution: make it autosave all the time. -Bethesda

  • @guywithknife
    @guywithknife2 жыл бұрын

    Just delete the code. Deleted code runs faster.

  • @user-mt2uh1ow7d
    @user-mt2uh1ow7d2 жыл бұрын

    you wont have to optimize if you do it right from the start in (C) c++ is bloated

  • @xeridea

    @xeridea

    2 жыл бұрын

    Yeah, so bloated that nearly every AAA game is written in C++.

  • @user-mt2uh1ow7d

    @user-mt2uh1ow7d

    2 жыл бұрын

    @@xeridea like they have choice

  • @Avighna

    @Avighna

    2 жыл бұрын

    @@user-mt2uh1ow7d C++ isn't bloated, the speeds are the same for almost everything in both of the languages.

  • @xeridea

    @xeridea

    2 жыл бұрын

    @@user-mt2uh1ow7d ... They do have a choice, they could use C. They could use other languages. C++ is used because it is generally as fast as C, but has far more features, and less error prone. It is much easier to write complex, yet still high performance code. Having more features doesn't make it "bloated", or slower, it gives more options. You can still use C style code in your C++ if you want, and for some situations it makes sense performance wise, because C++ features aren't always needed. Generally, replicating functionality that is easy in C++ in C isn't necessarily faster, and can introduce more bugs. C tends to be better for OS, and embedded system though. Neither language is objectively better, both have their strengths.

  • @user-mt2uh1ow7d

    @user-mt2uh1ow7d

    2 жыл бұрын

    @@xeridea stop repeating what you heard on internet, c++ is bloated, What features? What templates? that thing is the most retarted thing invented, alone with Bjarne, dude is an idiot, he even put a qoute, I made c++ so that it will be much more difficult to use, so that who ever masters it in 82 years will be dead, basically, people feel smart, but aint doing shit.

  • @moomsoon2068
    @moomsoon20682 жыл бұрын

    什么让你变得肥胖 My god!What makes you fat? I can't believe it. I don't love you anymore......

  • @nikkiofthevalley

    @nikkiofthevalley

    Жыл бұрын

    I can't tell if this is some kind of translation error, or just someone who is very rude.

  • @moomsoon2068

    @moomsoon2068

    Жыл бұрын

    @@nikkiofthevalley I'm just roast(but translation error,). I have great respect for cherno.