This was raised a the last developer meeting: https://docs.moodle.org/dev/Developer_meeting_May_2016
Moodle has a nice new template system (mustache). For what we read, it seem to be pretty fast. However, before we convert all the existing Moodle output to it, we want to be sure that won't cause a huge performance regression. How could we best do that.
My suggestion would be to take one or two significant bits of output: e.g. a forum thread, where you have a lot of posts, each of which contains some things like user pictures, buttons and icons. My other suggestion would be outputting a section of the course page, with half a dozen different activities.
Then really, just call both the old code, and the new code, in a loop a lot of times to compare the time. The only thing to do is to make sure, as much as possible, that it is a like-for-like comparison. That is, ensure both chunks of code that we are are doing just the work of outputting the HTML, and not doing work of getting data from the database.
Does anyone have a better idea? How much work would this be?