The remapping from old to new linked IDs was done one by one, with all
the related pre/post processing. In particular for objects, this could
easily lead to quadratic cost (need to loop over all objects for each
object)...
Solved by reworking the remapping logic in relocation code to process
all linked data in a single call.
From quick tests locally, it makes relocating a library with 10k object
got from 50s to about 5s.
A 40k linked objects case goes from 'way too long to measure' to about 4
minutes.
So there is likely still some things that could be improved here
(processing time still does not seem to be O(n)), but at least it's
usable now.
Pull Request: https://projects.blender.org/blender/blender/pulls/144207