Is it possible to update a custom attribute of an element without forcing a recalculation of canvas styles?

Hi there. I have a performance issue in a BPMN project with a lot of elements on the canvas. If I want to update a custom attribute of some element, the update forces the canvas styles to recalculate for no reason.

Example of code:

function updateSomeAttribute() {
    const modeling = modeler.get('modeling')

    modeling.updateProperties(element, {
        someCustomAttribute: 'some-value'

Graphics in chrome performance tab:

Unfortunately it is impossible to know for the renderer if an update is needed, i.e. whether the “very deep nested technical property you update is relevant for rendering”.

Hence we go the safe route and update all elements affected by a modeling change, which is usually a small amount of elements.

You could implement your custom ChangeSupport to somehow (magically) figure out if/when an element has been updated or patch the GraphicsFactory to cache renders (no visual impacting change happened).

We cannot make such assumptions as a generic toolkit.

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