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.

  • Use faster routing algorithms. By default, MATSim uses a routing algorithm based on Dijkstra's shortest path algorithm. But MATSim also includes a faster routing algorithm, based on the A* algorithm with landmarks. To use this routing algorithm, add the following configuration parameter to your configuration file:
    <module name="controler">
      <param name="routingAlgorithmType" value="AStarLandmarks" />
    </module>

Warning: Table 'watchdog' is read only query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Table &amp;#039;sessions&amp;#039; is read only\nquery: UPDATE sessions SET uid = 0, cache = 0, hostname = &amp;#039;38.107.179.233&amp;#039;, session = &amp;#039;&amp;#039;, timestamp = 1328352636 WHERE sid = &amp;#039;e972b2ab7dd755a2094beea8ac708f02&amp;#039;</em> in <em>/home01/vsp_access/matsimwww/includes/database.mysql.inc</em> on line <em>174</em>.', 2, '', 'http://matsim.org/node/344', '', '38.107.179.233', 1328352636) in /home01/vsp_access/matsimwww/includes/database.mysql.inc on line 174