typedInput performance issue?

Hello,

I face a performance issue in the editor when using change node with several rules.
To reproduce the "issue":

The panel opening takes a lot of times and the duration is directly correlated to the number of rules.
Also when resizing the panel, the refresh is quite long ...
The chrome debug tool shows that the addItem function from editableList (= add one rule) takes between 150ms to 250ms which seems very to me.

I figure out that removing all the typedInput fields (x5 per rule) in the the addItem function, fixes the performance issue.

Is it something to consider as normal in term of performance ?

It certainly looks like something that needs to be improved.

In 1.0 there was a performance improvement for the Switch node that reduces the number of typedInputs that are created - only creating those that are needed as and when they are needed - https://github.com/node-red/node-red/commit/c8e14f91e749aeb2bd4804181900f1fcdfaef1b8

A similar change is needed in the Change node.

1 Like

I just performed the same improvements on change node. It slightly improves the situation but still it's not perfect as there still (at least) 2 typedInput for each rule.

I also noticed some performance issue when resizing the panel width so I changed the way the "rule" width is processed. The performances are much better now when resizing.

Would you like me to raise a pull-request such as you can review my proposal and merge it if no problem ?

1 Like

Yes please.

Done : https://github.com/node-red/node-red/pull/2492

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.