When resolving pipeline primitives, use Python path to identify them

Because loading all primitives still takes a bit of time it can be an issue that currently for loading a pipeline we first have to load all primitives, even if they are not used in the pipeline.

The reason for this is because we are resolving primitives based on their ID. IDs should never change so this gives the best chance of finding an otherwise changed primitive (for better or worse). But for ID resolving to work we first have to load all primitives.

Loading from Python path has an advantage that it can work directly, without having to load all primitives. But it might also fail, because the primitive could not be found anymore under that path. Or even some other primitive might be now under that path.

So one optimization could be that we:

  • First try to load the primitive using Python path.
  • We check that the primitive we got match in ID, if so, we return it.
  • And if those two things fail, only then we load all primitives and try to resolve the primitive using just ID.