As I work on creating my website, I have come across an issue with lag when scrolling through a certain viewport that contains a canvas element. To address this problem, I am looking to analyze the browser's performance, specifically focusing on the frames per second (FPS). My goal is to develop a JavaScript function that will conditionally display the canvas only if the FPS is above 50.
For additional context, I am utilizing p5.js and have made efforts to optimize the code for better performance. Additionally, I am working within Vue.js framework.
That sums up the key details of my situation. Can anyone provide guidance on how to effectively evaluate browser performance in this scenario?