Performance issue found in Umbraco 9.5.1

The other week one of our teams discovered a performance issue on one of our Umbraco v9 sites. At first, we assumed the issue was related to something in our code, but after some investigation we found that this also was an issue in a clean install of Umbraco 9.5.1.

This issue only seems to be noticeable when working with a lot of content (500+ nodes) and it only applies when you are using a RenderController with either the ContentModel or ModelsBuilder generated model parameters. If you are using CurrentPage, it doesn't seem to be any issue.

I've added a lot of information in the issue on GitHub and extensive steps to reproduce. We haven't tried in older version yet but the issue has been reported in the GitHub issue tracker:
https://github.com/umbraco/Umbraco-CMS/issues/12579. If you have the time, please see if you can reproduce this issue in another (older) v9 version and share that information in the conversation.

Lastly I want to give credit to our team in Knowit Experience Linköping who found this issue. I merely just documented their findings, verified it on a clean install and reported the issue.