You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First create an unused_alt_route_names set for each Route, much like the existing unused_alt_labels. Populate it during Route construction, when the alt_route_names list is created. Then, either:
During .list processing, every time a Region+Name combo is matched, remove it from the unused_alt_route_names set. For primary names, we're just removing something that's already not there. :) This is the simpler-to-code option.
Create tworoute_hash tables, one for primary names and one for AltRouteNames. When a lookup in the primary table fails, check the alt table. When an AltRouteName match is found, remove it from the set.
Faster where, for the 99.82% of good .list lines not using AltRouteNames, we're not searching for a nonexistent primary name in the unused_alt_route_names set.
A tiny bit slower in the 0.18% of cases where AltRouteNames are involved, because we're looking up these entries in two hash tables instead of one, and in Unknown region/highway combo cases (which number 3.6x as many).
Counterbalanced to whatever degree by the primary name lookups being a tiny bit faster due to using a smaller set.
For another potential speedup, this enables us to remove the existing alt_route_names list (which would also save some RAM).
Right now, every time we find a region/highway match, we iterate through the alt_route_names list until a match is found, to add the deprecated route name ... -> canonical name note to the user log.
No iterating; instead, just add the note to the log as soon as a match is found via the alt_route_hash table.
Activity
yakra commentedon Dec 21, 2019
First create an
unused_alt_route_namesset for eachRoute, much like the existingunused_alt_labels. Populate it duringRouteconstruction, when thealt_route_nameslist is created. Then, either:unused_alt_route_namesset. For primary names, we're just removing something that's already not there. :) This is the simpler-to-code option.route_hashtables, one for primary names and one for AltRouteNames. When a lookup in the primary table fails, check the alt table. When an AltRouteName match is found, remove it from the set.unused_alt_route_namesset.Unknown region/highway combocases (which number 3.6x as many).Counterbalanced to whatever degree by the primary name lookups being a tiny bit faster due to using a smaller set.
alt_route_nameslist (which would also save some RAM).alt_route_nameslist until a match is found, to add thedeprecated route name ... -> canonical namenote to the user log.alt_route_hashtable.yakra commentedon Apr 7, 2020
I think it would be useful to have lists of both unused and in-use AltRouteNames.
yakra commentedon May 17, 2020
In-use AltRouteNames is a bit questionable. More useful would be a .log of all in-use .list names, whether primary or alternate.
yakra commentedon May 19, 2020
Similar to "option 2" for waypoint labels, .list names will be flagged as in-use:
.list processing enhancements