Search
Your task is to speed up Genetic algorithm (GA) solving Travelling Salesman Problem (TSP).
You probably need to do the following steps to achieve the desired speedup:
git fetch origin && git diff origin/master > tsp.diff.txt
You are not allowed to modify the parameters of the GA and to parallelize the algorithm! The possible speed up (with the preset parameters) is great (approx. from 120s to 4s).
The JDK itself provides a number of monitoring tools located in 'JAVA_HOME/bin' folder.
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
http://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr010.html
Unlike the rest, Java Mission Control is a commercial feature (free for development) of Oracle JDK. It can be used for monitoring provided also by VisualVM but its main feature is the Java Flight Recorder (JFR). 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.
https://docs.oracle.com/javacomponents/index.html
http://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr003.html
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr004.html
http://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr005.html
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.
http://docs.oracle.com/javase/8/docs/technotes/guides/management/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,…
Try to find the code that is executed a lot and find out if the results cannot be precomputed and reused. Avoid unnecessary object creation e.g. boxing and unboxing of primitive variables (int vs. Integer).