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:
- If I navigate to another workflow, and wait, something like GC kicks in and it goes back down to 4-7k.
- Navigating back to the original workflow, the event listeners stay low, and the UI is slow but responsive.
- 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.
- 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.
