As the saying goes, premature optimization is the root of all evil. Without sufficient knowledge and understanding of the system, optimization is often rather harmful. It is important to get the data of the system's runtime and find out what bottlenecks need to be optimized. Profiling is a method that we can use to collect information or signals that measure how the system works. The following information is helpful if we wish to find problems that exist in our application:
- Performance bottlenecks (CPU, I/O, memory, and so on)
- Statistics regarding the code's execution
- How long the execution time took to complete
By knowing about such information, we can make our application more performant. There are several tools we can use to inspect and get insight into what happens in the TensorFlow.js runtime. In the last section of this chapter, we are going to take...