Skip to content

Reflow per rendered row #5422

@vanslly

Description

@vanslly

Description

Reflow occurs once per row render, rather than once per grid render. Since a grid tends to have many rows, reflow per row is impacting performance significantly.

There's various ways this could be achieved.

  1. Considering that the horizontal scroll position is a property of the viewport of a grid, rather than an individual row. The scroll position should be externalized and provided to all rows, rather than each row individually querying the horizontal scroll position.
  2. A momoized function, that is module (webpack module) scoped, could be used for obtaining the horizontal scroll position when rendering a row.

Related is #5078 which resolved the issue of reflow being caused multiple times when a single row is rendered.

  • igniteui-angular version: 7.3.9
  • browser: Chrome 75

Steps to reproduce

  1. Create a new Angular app with igniteui-angular@7.3.9 as a dependency.
  2. Add a basic grid
  3. Use Chrome to performance profile the initial grid render.
  4. Notice the purple blocks on Chrome Dev Tools Performance Tabs's flame chart.

Result

NonCachedHorizontalScrollAcrossRows

You can observe how reflow gets worse per row rendered, because the DOM node count and event handler count is increasing for each rendered row.

By the time the 12th row is rendered reflow is more costly than the DOM insertions for the row.

Expected result

No reflow per row rendered. At most reflow should occur once per grid render.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions