Skip to content

Feature/optimize editor performance#7793

Open
sempostma wants to merge 17 commits intodecaporg:mainfrom
laikacms:feature/optimize-editor-performance
Open

Feature/optimize editor performance#7793
sempostma wants to merge 17 commits intodecaporg:mainfrom
laikacms:feature/optimize-editor-performance

Conversation

@sempostma
Copy link
Copy Markdown
Contributor

Note

I had to close and ropen #7719 because I moved my decap-cms fork repository to an organization.

This PR simply prevents a rerender of the entire EditorControl tree. This is done by making all the props stable, aka not passing new references when its not needed.

The risk with this change is that it's very easy for someone to create a new commit that reintroduces in an unstable prop which would cause the same performance issues again.

Summary

I'm using Decap for a project with a very large collection schema with reorder-able blocks and lists. On a 2024's machine, typing is almost impossible so not acceptable as a deliverable.

Test plan

The best way to test it is adding a 'shouldComponentUpdate' to the editorControl:

  shouldComponentUpdate(nextProps, nextState) {
    const valuesThatWhereUpdated = []
    for (const key in nextProps) {
      if (this.props[key] !== nextProps[key]) {
        valuesThatWhereUpdated.push(key)
      }
    }

    const stateValuesThatWhereUpdated = []
    for (const key in nextState) {
      if (this.state[key] !== nextState[key]) {
        stateValuesThatWhereUpdated.push(key)
      }
    }

    console.log('EditorControl shouldComponentUpdate', {
      valuesThatWhereUpdated,
      stateValuesThatWhereUpdated,
    })

    return true;
  }

If you add this to the current main branch, you will see hundreds of messages. After the change this drops to 3 or 4 (for each keystroke you type in a field for example).

Checklist

A picture of a cute animal (not mandatory but encouraged)

Clueless

@sempostma sempostma requested a review from a team as a code owner April 23, 2026 15:16
@sempostma sempostma mentioned this pull request Apr 23, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants