Skip to content
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

perf: use array of html struct instead of plain HTML Element #153

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Nov 9, 2023

  • the previous migration to plain/pure HTML Element was great for CSP but keeping a large array of HTMLElement can consume a lot of memory and is not the fastest especially when dealing with large dataset (thousand of items), what we can do instead of keep a minimal html struct (html tag name and the props/attrs that we are interested only), so whenever we need to recreate the list of element it is much quicker to create basic struct than it is to create thousand of HTMLElement and it consumes a lot less memory.
  • perf seems to double when using html struct instead of plain HTMLElement
  • the perf comparison was mostly done in the Large Dataset example which is where this PR will have the biggest impact

- the previous migration to plain/pure HTML Element was great for CSP but keeping a large array of HTMLElement can consume a lot of memory and is not the fastest especially when dealing with large dataset (thousand of items), what we can do instead of keep a minimal html struct (html tag name and the props/attrs that we are interested only), so whenever we need to recreate the list of element it is much quicker to create basic struct than it is to create thousand of HTMLElement and it consumes a lot less memory.
- perf seems to double when using html struct instead of plain HTMLElement
Copy link

github-actions bot commented Nov 9, 2023

🎭 Playwright Summary - Success 🎉

Playwright Report

[email protected] test:e2e /home/runner/work/multiple-select-vanilla/multiple-select-vanilla
playwright test --config playwright/playwright.config.ts

Running 69 tests using 2 workers
·····································································
69 passed (55.5s)

@ghiscoding ghiscoding merged commit 6731228 into main Nov 9, 2023
2 checks passed
@ghiscoding ghiscoding deleted the perf/row-item-conversion branch November 9, 2023 06:26
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.

1 participant