Testing loops for performance
Now that we have a firm grasp of the different types of loops and their advantages and disadvantages, we should feel empowered to make the best loop selections. Furthermore, we should be able to implement optimization strategies. But how do we know if our loop optimization strategies result in better or worse performance? That is where testing comes into play and is the focus of this section.
In this section, we will cover the following concepts:
- Profiling tools and methodology
- Benchmarking and testing strategies
- Case studies and examples
Our goal is to obtain the knowledge and practical skills needed to evaluate, optimize, and harness the full potential of loops within our Java applications. Moreover, we want to have a testing strategy that will inform us of the efficacy of our optimizations.
Profiling tools and methodology
It is not enough to write optimized loops in our Java applications. We should have a clear understanding...