ngrx / store-log-monitor

Log Monitor for @ngrx/store-devtools and Angular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Site gets really slow after a few dispatches to the store

dchacke opened this issue · comments

When I import the monitor, my site gets really slow after having done about 100 or so dispatches to the store. Basically every interaction with the site (scrolling, clicking on links or buttons, dragging things around, etc) is laggy and doesn't respond until after a few seconds have passed.

This may seem like a lot of dispatches, but I have events coming in to the site through a socket that dispatch to the store about every second or so, so that threshold is reached quickly.

Affected browser: Chrome Version 53.0.2785.116 (64-bit)
Affected OS: OS X El Capitan 10.11.6 (15G31)
Node version: v4.0.0
NPM version: 3.7.3

When instrumenting store you can specify a max age property that tells the instrumentation how many past states to keep. Try setting a number and see if that improves performance for you.

StoreDevtoolsModule.instrumentStore({
  montior: ...,
  maxAge: 10
})

Oh cool, got it. You may want to look into why it gets so long after just 100, but this solves it for me for now.

Thank you!