Slow runtime when assigning struct reference

please quote your code and provide a self-contained MWE