Table of Contents
How the CPU Runs Code
Physical & Virtual MachinesMiško discusses the virtual machine's role in the communication between code and the CPU. Parts of the CPU, including registers, arithmetic logic unit, and program counter and how they interact with memory, is also covered in this segment
CPU Basics & Speed LimitsMiško walks through the basics of a CPU, including its registers and memory operations. The limitations of CPU speed and the techniques used to make CPUs faster, such as increasing clock speed, parallelism, and adding more cores.
CPU Memory ManagementMiško explores memory management and introduces the concept of a program section and a data section in CPU memory. How CPU registers are used to load, store, and manipulate data within these memory sections is also discussed in this segment.
CPU Subroutines & Calling ConventionsMiško explains the concept of subroutines, their primitive nature compared to functions, and the mechanics of calling a subroutine. How data is passed, how registers are managed, the risks of stack overflow, and the role of the stack pointer in preserving program state are also discussed in this segment.
FibonacciMiško discusses the transition from low-level machine language to assembly language in computer programming, how assembly language provides a more human-readable and manageable way to work with machine-level instructions. The concept of subroutine calls and recursion using an example of implementing the Fibonacci sequence in assembly language is also covered in this segment.
Virtual Machine Inlining & Deopt
Optimizing CodeMiško discusses the trade-off between speed and memory in programming, how modern virtual machines analyze code for constants, inline functions for optimization, and deopt. A student's question regarding the performance of function declaration compared to function expression is also covered in this segment.
Object Shapes & Inline CachingMiško demonstrates the performance implications of using inline caching, discusses how inline caches work, and how they can optimize property access. Consider the shape of objects in your code and how inline caches can impact real-world performance, especially in complex frameworks and applications.
Object & Array CopyingMiško discusses using JSX, which converts into object literals, leading to potential performance issues when converting these object literals into DOM attributes. Benchmark comparisons between different approaches, such as using objects, arrays, and copying objects, to highlight the performance differences and considerations when working with JSX in real applications are also provided in this segment.