Async/await
Software hardly ever runs in isolation. Most software needs to reach outside of its boundaries and access something that is not part of the code block at some point. Examples include reading and writing files, reading data from a network, sending something to a printer, and so on. Suppose that a typical machine can access a byte in memory in about 10 nanoseconds. Reading that same byte from an SSD takes approximately 1,000,000 nanoseconds or even longer. Reading data from external devices is usually about 100,000 to 1,000,0000 times slower than reading local data from memory. Think about that when you try to optimize your code if you know that your software transfers data to and from external hardware.
Let’s take this one step further. Let us assume that you have a decent machine that can quickly process data. You need to read data from an external website. Your program must wait very long before that data is available. It can take milliseconds before that data...