Seems like `LinkAnnotation` will cause a performan...
# compose
t
Seems like
LinkAnnotation
will cause a performance issue when there are many
LinkAnnotation
in a
Text
, more in thread.
A reproducible example: https://github.com/Tlaster/LinkAnnotationTest I've tested in release mode, when scroll down and make
LinkAnnotation
text visible, the performance is really bad, and it's just 100
LinkAnnotation
As for a workaround, custom Annotation with pointerInput modifier to mimic LinkAnnotation behavior is working without any performance issue.
h
Link annotation creates placeable focusable layouts for the purpose of accessibility and keyboard focus movement. Therefore every instance of LinkAnnotation adds extra cost. I would expect some noticeable difference when there are 100 LinkAnnotations on a single text instance but please file a bug report if you think the performance hit is unreasonable.
t
I wish it could be better. I encountered this issue in a real-world scenario where a Mastodon post contained many hashtags. Scrolling through the post was very laggy.