By Tsachi Shushan, Software Engineer @
First instinct - find the problem (chrome devtools, webpagetest)
A better question: why didn't we know it's slow?
Added more metrics and dimensions
Leveraged our current monitoring system
Started with a basline
Created some simple metrics
<script>performance.mark('scripts-start');</script>
<script src="https://u.outbrain.com/amplify/static/vendor.87b3e4af58273a61209b.js"></script>
<script src="https://u.outbrain.com/amplify/static/app.10f8627e9a08eca68701.js"></script>
<script>performance.mark('scripts-end');</script>
...
performance.measure('ob_css_load_time', 'css-start', 'css-end');
performance.measure('ob_scripts_load_time', 'scripts-start', 'scripts-end');
performance.measure('ob_total_page_load_time', 'total-page-load-start', 'total-page-load-end');
const measures = performance.getEntriesByType('measure')
.filter(msr => msr.name.includes('ob_'))
.map(msr => {
return {
name: msr.name,
duration: parseInt(msr.duration),
browser: this.browserDetectService.type,
speed: connection ? connection.effectiveType : ''
}
});
this.http.post('/performance-benchmark', { measures });
Identified and solved number of problems
Raised developers awareness
Clearly see how changes to our code affect performance
Specific users flows
Memory leaks