Use a more appropriate data structure for nodeWrappers.
Since NodeWrappers lists:
must be insertion ordered
must contain only unique values (based on their key)
support a fast existence / lookup operation
This PR switches it from an array to a map.
As broccoli pipelines grow large, simply searching the array to detect duplicates on insertion can become very costly, and switching to a Map addresses this specific bottleneck.
Use a more appropriate data structure for nodeWrappers.
Since NodeWrappers lists:
This PR switches it from an array to a map.
As broccoli pipelines grow large, simply searching the array to detect duplicates on insertion can become very costly, and switching to a Map addresses this specific bottleneck.