Checking Load Times of Individual Components in a Page


We recently have been trying to find components (widgets/parsed vtls/containers) that are taking too long to load and could use optimization. One potential way of doing this is adding the code in the code section to a piece of web page content and reusing that content between different components (widgets/parsed vtls/containers).

While the code is actually quite simple, it does help quite a bit. Basically, it just get's the system time and prints the minutes, seconds and 4 milliseconds when the code is processed. When it prints the time, it's in an HTML comment so only visible from the source. In addition, it autoincrements the 'Sequence' number so you can track in what order they fired.

Comparing these date values can show you what components on your page could use some optimization. Hope this helps!


	#set($timer_test = $timer_test + 1)
	#set($timer_test = 1)
<!-- Sequence ${timer_test}: $date.get("mm:ss.SSSS") -->​