Repository navigation
performance gains - #588
Merged
Merged
Conversation
R5's McRAPTOR target pruning only runs when request.maxFare < 0, but r5r passed Integer.MAX_VALUE without a fare structure, so every Monte Carlo draw searched the whole network. TripPlanner now: - turns the pruning on during route() when there are no fares, and resets R5's best time at the target at the start of each draw (it is kept across draws upstream, which would prune valid trips of later draws); a guard throws if R5 stops calling the hook once per draw; - drops states later than the draw's departure + max_trip_duration (as FareDominatingList already does), and with shortest_path also states slower than the fastest trip found so far. Results are unchanged (15 + 9 scenarios on poa/spo); only with suboptimal_minutes > 0 can the option numbers of exactly tied itineraries swap. About 1.5x faster at max_trip_duration = 60 and about 4x with the defaults (100 pairs, 2 cores). Routing with fares is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R5TravelTimeComputer, r5r's copy of R5's TravelTimeComputer, ran a second street search on foot after every car or bicycle search, also without transit. Upstream R5 v7.5 runs it only with transit (to reach stops in pedestrian-only areas). Car-only and bicycle-only routing in travel_time_matrix(), expanded/arrival_travel_time_matrix(), accessibility() and pareto_frontier() is 2.5 to 4 times faster. Bicycle results are unchanged; some car-only trips no longer end with a walk not limited by max_walk_time and get 1 to 8 minutes longer (3% of pairs in poa), now consistent with isochrone(). Also build the travel_time_pNN column names once per origin instead of per destination. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Performance gains for detailed_itineraries() and car/bicycle travel time matrices (performance_gain protocol). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
r5r benchmark: CRAN 2.4.0 vs dev 2.4.0.9001
Transit (WALK + TRANSIT)
Car
Median of 3 reps. Time gain = CRAN/dev speed-up (% change in time). Memory = memory allocated during the call by Java (all threads) + R; peak Java heap and the parts are in the CSV. Row-count differences > 1%:
Resuls are identical on all cases, except on a few cases where the dev versions fixes bugs, like in arrival_travel_time_matrix |
start_r5r_java() called rJava::.jinit(parameters = c(log_path, ...)),
which replaces .jinit()'s default getOption("java.parameters"). Since
v2.2.0 a user's -Xmx (and any other JVM option) was silently dropped and
Java ran with its default heap. The user's options are now prepended to
r5r's own -D flags. Verified in a fresh session: -Xmx60G gives a 60 GB
heap (29.5 GB before, the JVM default on a 256 GB machine).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.