Merge "Cache optimizations for setting parent-refs"