How To Speed Up MATSim Runs

The following list gives some hints on how to speed up MATSim simulation runs.

  • Use an up-to-date Java version: Java 6 usually performs better than Java 5.
  • Use Compressed Object Pointers in 64-bit JVM (available since Sun Java 6 Update 14). If you use a 64-bit JVM and use at most 32 GB of RAM, start Sun's Java virtual machine with the argument "-XX:+UseCompressedOops". This reduces the size of object pointers to 32 bit, making many pointer operations a lot faster than when they were 64 bit long, while still supporting heap sizes larger than 2 GB (what a regular 32-bit JVM would do). See the Java SE 6 Update 14 Release Notes for more details. In addition, we observed notable speed-ups in the region of 10% in the run time of MATSim.
  • Limit writing events. Writing the simulation events to files in each iteration not only consumes a lot of disk space, but also a considerable amount of time. Add the following parameter to your configuration to restrict writing events to certain iterations.
    <module name="controler">
      <param name="writeEventsInterval" value="10" />
    </module>

    This will instruct the MATSim Controler to write events only every 10th iteration, which is usually enough for analyses.