Skip to content

perf: speed up cell rendering #4724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukecotter
Copy link
Contributor

  • Remove an extra call to innerHTML which saves time by avoiding the HTML having to be unnecessarily parsed.
  • Replace innerHTML = '' with while(this.element.firstChild) this.element.removeChild(this.element.firstChild); which appears to be faster.

This avoids the input needing to be parsed which we are going to do later anyway.
It is faster than using innerHTML = ''
@lukecotter lukecotter changed the title perf: improve cell rendering perf: speed up cell rendering Mar 25, 2025
@rathboma
Copy link
Collaborator

Hey! Was the previous implementation causing some issues for you?

@lukecotter
Copy link
Contributor Author

lukecotter commented Apr 17, 2025

@rathboma
Not a huge issue but when profiling I noticed quite a bit of time spent in parseHtml.

This speeds up rendering quite a bit for me especially when the virtual renderer is not being used.

If you want I can provide some timings.

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