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

Paint each cell exactly once? #148

Open
JoshKarpel opened this issue May 13, 2024 · 0 comments
Open

Paint each cell exactly once? #148

JoshKarpel opened this issue May 13, 2024 · 0 comments

Comments

@JoshKarpel
Copy link
Owner

JoshKarpel commented May 13, 2024

Right now in paint_layout(), we paint every element, then use dictionary merging to layer them on top of each other. This is wasteful, since we can use z-layers and element ordering to determine which element ultimately paints each cell - i.e., a map of cell -> element that will paint that cell. We can then ask that element to paint just that cell.

This might be an optimization for very complex layouts, because we should end up painting fewer cells total (just each cell exactly once instead of some cells many times and then being overridden).

This is pretty bad now that we can paint content too - it means that the amount of painting tends to scale with the area of the divs, not just their surface area.

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

No branches or pull requests

1 participant