Skip to content

Avoid an excessive DOM size #434

Description

@wisniewski94

Step 1: Describe the problem:

Steps to reproduce:

  1. Open Demo
  2. Run the lighthouse performance audit

Observed Results:

  • You should see Avoid an excessive DOM size (3,458 elements) error

This is because of the use of the HTML tables which add a few layers of depth to the DOM tree. With more complex usages this number can grow up to 10k+. I don't think this problem can be completely solved because highlight.js adds a lot of HTML elements but it should be possible to lower this number a bit by avoiding the <table> element. Proof of concept is browser visual studio code diff which uses only a combination of divs and spans.

I am going to spend some time on this issue to see what are potential cons of this approach.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions