From Jason Turner
Watch on YouTube

Summary

This episode examines how using the wrong integer type can significantly impact performance. Jason demonstrates a quick sort implementation that was 1.3 times slower than a comparable version, and shows how changing a single variable from int to std::size_t resulted in a nearly 10% performance improvement. Using Compiler Explorer, he explains that the performance difference comes from the runtime cost of sign extension operations required when converting between signed 32-bit integers and unsigned 64-bit integers.

Resources

Tags