Skip to content

[Pay meow] Display all SVG images on UI thread using native libraries #29067

Description

@muttmuure

Problem

We’re rendering SVGs using react-native-svg library which is not intended for displaying static images from web or assets. It affects our performance hugely, as rendering big SVGs might take a long time - for BackkgroundImage on Android debug build I’ve seen times like 380ms on pretty powerful Pixel 7

Solution

We should display all SVG images on UI thread using native libraries.

Currently, we have react-native-fast-image in place for displaying PNGs. Unfortunately it does not support SVGs.

We could either migrate to another image library (like expo-image) or add SVG support for react-native-fast-image

For the sake of benchmarking, adding basic support for SVGs in react-native-fast-image on android and comparing its performance to react-native-svg shows HUGE results!

For smaller SVGs, namely for Icons on Settings page (which are mostly one path) it also reduces render time hugely, but since base time is small (2-4 ms) it’s not that huge of a deal.

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionWeeklyKSv2

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions