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.
This pull request introduces significant performance optimizations and new features to the routing logic in the Essentials Core, particularly in the
Extensionsclass. The main improvements include the addition of indexed lookups forTieLines, caching of impossible routes to avoid redundant calculations, and the introduction of a pre-mapping mechanism for route descriptors. These changes are aimed at making route discovery and execution much faster and more efficient, especially in large systems.Routing Performance Optimizations:
_tieLinesByDestination,_tieLinesBySource) forTieLinesto speed up route lookups and provided methods to initialize and use these indexes instead of repeated LINQ queries._impossibleRoutes) for impossible routes to prevent repeated attempts at finding non-existent paths, including logic to add to and clear this cache. [1] [2]Route Descriptor Pre-mapping and Utilization:
RouteDescriptorsdictionary, mapping each signal type to a collection ofRouteDescriptorobjects, and implemented aMapDestinationsToSourcesmethod to precompute and store all possible routes at startup. [1] [2]Other Improvements and Bug Fixes:
GetRouteToSourceto ensure only valid, non-empty route descriptors are returned, preventing downstream errors.DeviceManager.GetRoutingPortsto display both the key and signal type for each port, aiding in debugging and diagnostics.These changes collectively make routing operations more scalable and reliable, particularly in environments with many devices and complex routing requirements.