Skip to content

Refactor workspace grid to use single pattern definition#5735

Merged
knolleary merged 3 commits into
devfrom
5728-workspace-grid-dom-element-reduction
May 11, 2026
Merged

Refactor workspace grid to use single pattern definition#5735
knolleary merged 3 commits into
devfrom
5728-workspace-grid-dom-element-reduction

Conversation

@Steve-Mcl

@Steve-Mcl Steve-Mcl commented May 10, 2026

Copy link
Copy Markdown
Contributor

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

closes #5728

Proposed changes

Replace the individual dom line elements with a single rect that uses a pattern def

Before and after

Stats:

(index) before after ratio
elements (DOM nodes under gridLayer) 800 4 '200.0x'
markup size (bytes) 70219 402 '174.7x'
updateGrid avg (ms, x1000 calls) '1.632 (rebuild)' '0.003' '652.8x'
       

Comparison

  • Original lines on the left
  • Pattern def grid on the right
nr--orig-grid-left--new-grid-right.mp4

DOM

image

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@Steve-Mcl

Copy link
Copy Markdown
Contributor Author

This was developed on Chrome (Blink) but before merge, we should test on Safari (Webkit) & Firefox (Gecko)

@knolleary

Copy link
Copy Markdown
Member

Chrome looks okay. Seeing some inconsistencies in Firefox/Safari.

The grid lines appear slightly thicker:

  • Before
    SCR-20260511-jtyb
  • After
    SCR-20260511-jtzs

When zoomed out, it is more apparent (and distracting):

  • Before
    SCR-20260511-juew

  • After
    SCR-20260511-juca

@Steve-Mcl

Steve-Mcl commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

@knolleary 2nd last idea applied in 0edd9560edd956 (I have one more after this)

@knolleary

Copy link
Copy Markdown
Member

@Steve-Mcl much better across the 3 browsers.

@knolleary knolleary merged commit 0e51a72 into dev May 11, 2026
3 checks passed
@knolleary knolleary deleted the 5728-workspace-grid-dom-element-reduction branch May 11, 2026 17:08
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.

[Performance] Improve the workspace grid using an SVG pattern instead of individual line elements

2 participants