opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.21k stars 1.03k forks source link

Slow (8 minutes) transfer generation #1844

Closed bertspaan closed 4 years ago

bertspaan commented 9 years ago

Command:

java -Xmx4G -jar otp/otp-0.14.0.jar --build ./otp/data

Output:

13:20:39.824 INFO (DirectTransferGenerator.java:63) Creating direct transfer edges between stops using the street network from OSM...
13:28:03.389 INFO (DirectTransferGenerator.java:103) Done connecting stops to one another. Created a total of 27465 transfers from 17948 stops.

Input files:

JordenVerwer commented 9 years ago

This is normal and expected. All transfers are calculated on the actual street network, which takes time.

abyrd commented 9 years ago

Yes but 8 minutes just for Amsterdam? That seems too slow.

abyrd commented 9 years ago

I realize there are some big feeds in there (NS) but it should fail fast on the stops that are not near any streets.

JordenVerwer commented 9 years ago

Ah, I didn't notice that the OSM extract had been limited to Amsterdam. In that case I agree that it's a bit slow, although the combination of a limited OSM extract and GTFS feeds for the whole country (even if not all agencies are included) probably doesn't see much use, so I don't really have a feeling for what amount of time would be reasonable.

abyrd commented 9 years ago

It would be nice if this combination (big train feed, small OSM extract) would properly skip over stations that have no nearby streets, since that's the only reasonable way to include trains in a local testing deployment. But I also don't know how long we should expect the search to take. I will check if it's using a simple, fast search technique like earliest arrival for the transfer calculations.

abyrd commented 9 years ago

The problem was at least in part caused by a bad input file that contained all the NS stops twice. But the process still takes 6 minutes which seems unreasonably long for generating a one-city test graph to me.

JordenVerwer commented 9 years ago

It could be that the attempts to be clever with patterns are actually detrimental in this situation. In any case the code has change too much since I originally wrote it that I don't know where performance bottlenecks are to be expected anymore.