Skip to content

[EuiIcon] Custom SVG slows down the rendering  #5741

@kpatticha

Description

@kpatticha

I used the react profiling tool to debug why the table takes time to render and I figured it out that EuiIcon required more time to render than the actual table and there were blocking the rendering.
The issue is more visible when I sort the table as you can see in the following recording. This does not trigger a new data fetch just a frontend sorting.

Screen.Recording.2022-03-23.at.13.04.41.mov

In APM we use the EuiIcon with custom SVGs

We convert the SVGs to data URI and we pass it to the component like that

<EuiIcon type={icon} size={size} title={agentName}

where the icon data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+.....

On our end I solved the problem by replacing the EuiIcon with EuiImage but I'm interesting in understanding what caused the issue.

Did we use incorrect the component from our side or it can be an issue on the component itself?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions