-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance problem with large number of item #4
Comments
Facing the same issue with 1000+ elements |
Do not use "opacity". Use fill="rgba(r, g, b, a)" instead. |
Is it fast without zoomable-svg? Can you measure the difference with and without? I suspect zoomable-svg contributes very little to any performance issues. You should probably look into refactoring out your content to a separate component and using shouldComponentUpdate. Such that only the updated transform needs to reconciled and sent over the bridge to the native side. Otherwise you might need to look into culling your render trees, such that you only include elements which should actually be visible in the currently visible area, to limit any redundant or output/side-effect free parts of the computation. |
I'm using react-native-svg-pan-zoom, which transforms the view around the svg instead of the svg itself. |
@yuoppp is react-native-svg-pan-zoom performs faster than zoomable-svg in such cases? |
If your content doesn't change, or you don't care about the image getting pixelated when zoomed in, then it'll certainly be faster to transform the bitmap rather than rerendering the vector data. |
I use the
zoomable-svg
to draw many item with pan and zoom, but it has bad performance.This is the gif:
gif.gif
The text was updated successfully, but these errors were encountered: