Search
Your task is to speed up a variant of Multi-Objective A* solving Bi-Objective Shortest Path Problem.
You probably need to do the following steps to run the algorithm:
git fetch origin && git diff origin/master > mosp.diff.txt
Most of the IDEs now integrates some of the profilers (e.g. IntelliJ IDEA Ultimate from version 2019.3). It is the easiest way to get insight of what is happening during the execution; however, other more specialized tools typically provides more information.
The Java VisualVM is a baseline for profiling Java applications. It allows you to use both sampling and instrumentation approaches to profile the application. It allows to measure time spent in functions and see statistics about objects on the heap. It can also generate and analyse heap dumps, monitor garbage collector (and invoke it) and monitor threads.
https://visualvm.github.io/documentation.html
Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data about a running Java application. It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments. The JFR can record detailed information about various aspects of the application - e.g. object statistics, compilation, detailed GC info, I/O operations, exceptions,etc.
Java Mission Control (JMC) is the usual tool to examine JFR recordings. It can also start and configure JFR recordings.
Flight Recording can be started automatically with VM arguments:
-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:StartFlightRecording=duration=10s,filename=myrecording.jfr
https://www.oracle.com/technetwork/java/javaseproducts/downloads/jmc7-downloads-5868868.html
https://docs.oracle.com/javacomponents/index.html
Async-profiler is a low overhead profiling tool for Linux/macOS that uses perf. It has been recently integrated to Linux/macOS version of IntelliJ IDEA Ultimate.
https://github.com/jvm-profiling-tools/async-profiler
JConsole is a tool with a basic monitoring functionality - heap size, CPU usage, thread monitor, etc. But it also allows using JMX instrumentation in order to see JVM parameters and in some cases it also allows you to change the parameters.
https://docs.oracle.com/en/java/javase/11/management/using-jconsole.html
There are also some command line tools (jcmd, jhat, jinfo,…) but most of their functionality is covered by the tools described above.
jcmd, jhat, jinfo,…
All necessary software should be available on Ubuntu system in the labs (not the KDE Debian used for the first assignment). You may need to set the password first at https://www.felk.cvut.cz/
IntelliJ Idea Ultimate:
/opt/idea/idea-IU-193.6015.39/bin/idea.sh
JMC
/opt/jmc+jmc-7+14_linux-x64/bin/jmc
VisualVM
/opt/visualvm_144/bin/visualvm
Try to find the code that is executed a lot and look what look suspicous. Avoid unnecessary object creation e.g. boxing and unboxing of primitive variables (int vs. Integer). Profile also the memory and look what objects are created the most (maybe even analyze heap dump). Is it really necessary to create all those objects?
Try to use various tools and methods, sampling vs instrumentation (in visualvm called profiling). Since their implementation and methodology differ they suffer from different profiling errors; therefore, they could provide different insights into the program.
You can also leverage knowledge about data that are handled by some data structures. You should ask following questions if profiling shows you that some data structure could be the bottleneck: What is the purpose of this structure? Do I know anything about the data that this data structure handles? Can I use different, faster (e.g. less general), data structure that leverages the knowledge about the data?