Performance Tests to show Mechanical Sympathy principles in Java
To run the IO tests, run the main in TestSequentialIoPerformance.java. All other tests use the JMH framework.
To build the JMH tests:
- Make sure you have Java and Maven installed.
- Clone the repo
- cd into the directory
- Run mvn clean install
JMH runs benchmarks over and over again to get good statistical sample. If you are in a hurry, you may lower the number of Forks to 1. The different options for running JMH benchmarks can be found here. Otherwise, I recommend running them over night.
java -jar target/benchmarks.jar net.askren.mechanicalsympathy.jmh.ArrayVsLinkedList
java -jar target/benchmarks.jar net.askren.mechanicalsympathy.jmh.TestMemoryAccessPatterns
Run java -cp target/java-performance-0.0.1-SNAPSHOT.jar net.askren.mechanicalsympathy.TestSequentialIoPerformance