In this chapter, we’ll discuss how to check the performance of our code. As usual, we are interested in time and space usage characteristics. We’ll discuss how to compare different implementations of the same function in terms of execution time using benchmarking and choose the most suitable implementation. We’ll explore time and space consumption of our programs (we call it profiling) and use this information to find drawbacks in the implementation, such as space leaks. Finally, we’ll see how to use benchmarking and profiling to make our programs run faster.