In earlier versions of Unity (version 5.3 and older), the references to Transform components would be laid out in memory in a generally random order. This meant that iteration over multiple Transform components was fairly slow due to the likelihood of cache misses. The upside was that re-parenting GameObject to another one wouldn't really cause a significant performance hit since the Transforms operated a lot like a heap data structure, which tend to be relatively fast at insertion and deletion. This behavior wasn't something we could control, and so we simply lived with it.
However, since Unity 5.4 and beyond, the Transform component's memory layout has changed significantly. Since then, a Transform component's parent-child relationships have operated more like dynamic arrays, whereby Unity attempts to store all...