Skip to content
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

Open
shuijinliuxi opened this issue Apr 24, 2018 · 6 comments
Open

Performance problem with large number of item #4

shuijinliuxi opened this issue Apr 24, 2018 · 6 comments

Comments

@shuijinliuxi
Copy link

I use the zoomable-svg to draw many item with pan and zoom, but it has bad performance.
This is the gif:

gif.gif

@yuoppp
Copy link

yuoppp commented May 17, 2018

Facing the same issue with 1000+ elements

@yuoppp
Copy link

yuoppp commented May 17, 2018

Do not use "opacity". Use fill="rgba(r, g, b, a)" instead.
Saved me 4 seconds of rendering. But still 1sec render is unacceptable for my app.

@msand
Copy link
Owner

msand commented May 25, 2018

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.

@yuoppp
Copy link

yuoppp commented May 25, 2018

I'm using react-native-svg-pan-zoom, which transforms the view around the svg instead of the svg itself.

@MozilaIP
Copy link

@yuoppp is react-native-svg-pan-zoom performs faster than zoomable-svg in such cases?

@msand
Copy link
Owner

msand commented Jan 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants