perf: stream GTFS into typed arrays and grid the walking transfers #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf-typed-feeds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Groundwork for adding bus feeds, with no behaviour change.
Today the loader builds a JS object per csv row and per stop time, and a JS array per connection; walking transfers compare every pair of stations (O(n^2)). That is already the slowest part of startup with subway + Metro-North, and it does not survive buses: MTA's five borough feeds plus MTA Bus Company and Bee-Line add roughly 17k stops and 7.6M stop times, versus ~0.6k and ~0.5M today.
Changes:
Trip.stopStart/stopCount, read viaGtfs.tripStops)Verification
A fixed set of four queries (Overlook Terrace -> Bronx Zoo, Grand Central -> Coney Island, Scarsdale -> Union Square, Astoria -> JFK, transit-only so results are deterministic) returns byte-identical itineraries before and after - same legs, stations, times, fares and transfers.
Startup on the current two feeds:
Next PR adds the bus feeds themselves (
busmode, fares with free subway<->bus transfers, Bee-Line from the 511NY-hosted feed - the Westchester-hosted copy is stale).