Search code examples
javascriptperformancegoogle-chromemobx

Mobx How to get better performance profile information?


I am trying to profile and optimize a mobx app using the Chrome inspector performance tab. There is a screen shot below.

enter image description here

Lots of information in this stack trace is misleading and unhelpful as it points to internal mobx functions like trackDerivedFunction. Because mobx @computeds rely on the the get helper you can see the bottom of the stack trace is is many calls to get and not much helpful information. Some of these do link to actual functions in my code however some link to more internal mobx.

You can see there are many calls to endAction is there any way to show what action that was? I'm looking for suggestions for any other mobx plugins or devtools to help with this.


Solution

  • Mobx spy works reasonably well for tracking what actions are being triggered.

    https://mobx.js.org/refguide/spy.html