Reparenting game objects is slow

I have just written an Editor script to reparent game objects and I find that it is performing very poorly.

I am using the following code:

foreach(GameObject obj in gameObjectsToReparent)
{
    obj.transform.parent = newParentGameObject;
}

For 190 game objects the above loop takes an average of 16s. I find it to be rather slow but maybe reparenting a game object involves a lot of work in the background.

Am I doing something stupid in my code? Is this kind of performance to be expected?

I got to the bottom of this. Deactivating all the box colliders before reparenting the game objects brings the processing time down to less than two seconds.