I’m not sure if such tool exists but if it does, please point me to it.
It works like this: you play with the UI of you page for a few minutes and then you can see how many times the browser spent executing each javascript function and how much time does each function take to execute on average.
So for instance, we could say function X is used a lot and takes a long time to execute.
I use chrome so may be other browsers do this. Let me know.
chrome’s developer tools has what you call “Timeline”.
then it will record your actions, page events, etc.