Unbelievably slow UI

Maybe a clue?

On a whim, I decided to check how many JS event listeners were registered… there’s over 75k+!!!

Reddit.com has 4,000, and it’s one of the worst performing websites I know. N8n.io has 1,105, github.com has 8,600.

This behavior definitely ‘feels’ like JS thread blocking to me. Is there something (a node, a config, etc.) that could be creating duplicate or erroneous JS event listeners.

Notes:

  1. If I navigate to another workflow, and wait, something like GC kicks in and it goes back down to 4-7k.
  2. Navigating back to the original workflow, the event listeners stay low, and the UI is slow but responsive.
  3. As I continue using the workflow, I’m seeing the number of event listeners climb by 2-3k each time I open a node, and doesn’t go back down when closing it. As I’m doing this, the UI is getting laggier and laggier.
  4. Refreshing the page drops the JS heap size and event listeners down HUGELY.

Edit: I can confirm that the lag on the UI is directly proportional to the # of event listeners.