Skip to content

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