Compiler Optimization

preview_player
Показать описание
When you write and compile code, your compiler doesn't have to simply translate your code to a machine readable form. Instead, it can also perform optimization, to make your code run faster! Today, we explore some of the simplest ways in which your compiler can achieve this.

= 0612 TV =
0612 TV is your one stop for general geekery! Learn about a variety of technology-related subjects, including Photography, General Computing, Audio/Video Production and Image Manipulation! Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!

Рекомендации по теме
Комментарии
Автор

Excellent video. Everything is easily understandable.

hamzasaleem
Автор

Your videos are so high in quality, I'm glad I found your channel.
Hope others will too :)

philipplsgfwpjhac
Автор

you are thorough as ever. really great.

PratikAnand
Автор

I have been wondering, what kind of information we could provide within our source code, for example through annotations, that could help the compiler to optimize better or to allow completely new optimizations? We could add new annotations as we find more useful information for compilers. What kind of information the developer knows of how his code should work that the compiler could use?

juzujuzu
Автор

Bro what is auto tunning technique of compiler optimization???

mrexplain
Автор

Bit-shifting as an alternative to multiplication or division is not an optimization. In fact, an optimizing compiler will turn a bit-shift into a multiplication or division in assembly for all modern x64 processors because it actually runs faster.

ColaEuphoria
Автор

It's funny how many of these optimizations can be avoided by a experienced coder. it's like the compiler is expecting the user to not be very experienced, and fixing the "problems" (not actual problems, but code that can be easily optimized)

In this way compilers are not far away from user friendly programs or operating systems.

gustavrsh
Автор

The part about the compiler changing 'x = x + 1' to 'x++' is not correct. Both are single instructions and both will result in the same instructions being used - most of the time.

The compiler has the choice of one of the two:

add [x], 1
inc [x]

... and neither of these instructions 'add then assign'. If that were the case, then the compiler would output the following which it does not:

mov eax, [x]
add eax, 1
mov [x], eax

OR

mov eax, [x]
inc eax
mov [x], eax

Good information otherwise.

pprocacci
Автор

full stop. this man made the sound effects of his intro with his own voice.

killjaqular