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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.