opentripplanner/OpenTripPlanner — pull request #1575 by JordenVerwer (2014-10-30 15:13:48+00:00)
Title: Move TurnRestriction List from StreetEdge to Graph

I moved the List of TurnRestriction objects inside each StreetEdge to a private Map inside Graph. This is meant to reduce the memory footprint as part of issue #1527.

I used a NY state OSM extract from Geofabrik to see what the effects were.

Before I made my changes, the sizes were as follows:
Graph size on disk: 256.691.161 bytes
Approximate OTP memory consumption after loading the graph from disk: 671 MB

After I made my changes, the sizes were reduced to:
Graph size on disk: 245.908.938 bytes
Approximate OTP memory consumption after loading the graph from disk: 654 MB

That implies a 2.6% reduction in memory usage and a 4.4% reduction in graph size on disk. Of course these numbers will be different for different OSM extracts, but I do not believe the graph size could increase under any realistic scenario.

This pull requests doesn't make any tests fail and there do not seem to be (nor should there be) any changes to OTP's functionality. While I was adapting the code to the changes I made, I removed some dead code in the process. I did not check whether the TurnRestriction removal code in StreetEdge's detachFrom() is really necessary or can be removed altogether.