Warning

This page is located in archive.
Go to the latest version of this course pages.

Your task is to measure time performance of three different implementations of matrix multiplication and compare them:

- Standard multiplication
- Multiplication with the second matrix transposed before the multiplication
- Multiplication of the matrices in 1D representation

You probably need to do the following steps:

- Download the program from git repository: git clone https://gitlab.fel.cvut.cz/cuchymar/benchmarking.git
- Open the source code in IDE
- Use Java Microbenchmark Harness (JMH) to rigorously compare the implementations
- Do the measurements on each of the implementations of the matrix multiplication according to the methodology described in [1] - summary in PDF
- Determine the warm-up period for each implementation
- Visual inspection of a sequence plot is sufficient

- You do not have to calculate the number of repetitions
- Use sufficiently large number (e.g. 40 iterations and 30 executions/forks)
- If the resulting confidence interval is too wide, you need to add more repetitions.

- Measure the time performance for each implementation and compute the average performance and 95% confidence interval of the measurements (Section 9.3)
- Compute the comparison ratios of the implementations and 95% confidence intervals of the ratios (Section 10.1)

- Upload the report (PDF) with the results together with your implementation of the benchmark (MatrixMultiplicationBenchmark.java) and the JSON file with the measurements generated by JMH.

The confidence interval you are supposed to calculate are NOT the confidence interval that is shown by JMH

The report should include the following parts:

- Machine specification - CPU, memory, OS, Java version (
`java -version`

), etc. - Used JVM parameters (if applied)
- Warm-up period:
- Brief description of how the warm-up period was determined
- The results (with graphs) for each implementation

- Time performance:
- Brief description of the measurement procedure
- Results including graphs with visualization of the confidence intervals (example https://i.stack.imgur.com/HmBYh.png)

- Comparison:
- Brief description of how the comparison was done
- Resulting ratios with the confidence intervals

- Conclusions:
- Summary of the results and a discussion

JMH is a Java harness for building, running, and analysing nano/micro/milli/macro benchmarks written in Java and other languages targetting the JVM.

https://openjdk.java.net/projects/code-tools/jmh/

There is a plenty of tutorials, e.g.:

- [1] https://kar.kent.ac.uk/33611/ (mainly chapters 9.3 and 10.1)
- [2] Kalibera, T. and Jones, R. E. (2012) Quantifying performance changes with effect size confidence intervals. Technical Report 4–12, University of Kent
- [3] The slides from the third lecture
- [4] Pitfalls presented at the seminar: https://www.oracle.com/technical-resources/articles/java/architect-benchmarking.html

courses/b4m36esw/labs/lab03.txt · Last modified: 2020/04/07 21:49 by cuchymar