Skip to content

Performance Issue for Custom Table renderer component #2242

@howdyAnkit

Description

@howdyAnkit

Describe the bug

The given scenario highlights performance issues caused by excessive function calls, leading to latency problems, particularly in a nested object scenario within a custom Angular table renderer. To improve performance, consider optimizing the function calls and reducing unnecessary re-render.

Here's a a suggestion how I approached the problem using Angular's PurePipe to optimize function calls:

PurePipe: Utilize an Angular PurePipe to reduce unnecessary re-render of complex logic in the template.

while i was debugging I noticed that even while we are hovering certain elements this function was called unnecessarily multiple times even though when we are not making interacting with UI or performing any action.

By incorporating PurePipe in your Angular component, you can significantly optimize function calls and improve performance, especially in scenarios involving complex nested objects or custom renderers.

https://github.com/eclipsesource/jsonforms/blob/master/packages/angular-material/src/library/other/table.renderer.ts

Expected behavior

The getProps function should only be getting called when a user is performing any action releated to the Table to prevent memory leaks.

Steps to reproduce the issue

  1. Add a custom renderer(https://github.com/eclipsesource/jsonforms/blob/master/packages/angular-material/src/library/other/table.renderer.ts)
  2. Make sure you have lot of nested data and dataset is huge.
  3. place a console statement inside the getProp function and Observe the statement getting triggered on one click of add multiple times same with delete and also while you are hovering any elements on the table.

Screenshots

No response

Which Version of JSON Forms are you using?

v3.1.0

Framework

Angular

RendererSet

Material

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions