Appendix A. Performance Measurement

This appendix describes the framework used to measure the data on collection performance described in Chapter 9. The problem is stated simply enough—accurately compare the time needed to perform several operations as they scale. However, the problem becomes more complicated when the accuracy of the timer is much less than the time required to complete the operations. The time tester presented here overcomes these problems by performing operations many times. It adapts to the accuracy of the timer by fixing the amount of wall clock time used to measure each operation.

Accurately benchmarking operations in an optimizing implementation of Java requires more knowledge than what is presented here, either in the ...

Get Implementation Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.