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

Inline svg in LikeButtonV2 might cause performance issue #308

Open
williamchong opened this issue Nov 2, 2020 · 0 comments
Open

Inline svg in LikeButtonV2 might cause performance issue #308

williamchong opened this issue Nov 2, 2020 · 0 comments

Comments

@williamchong
Copy link
Member

e.g.

d="M75.1,69.7a1.09,1.09,0,0,1-.9-.4,1.24,1.24,0,0,1,.1-1.7,25.87,25.87,0,0,0,5.2-5.9,4.41,4.41,0,0,1,4.3-2.4,1.22,1.22,0,1,1-.4,2.4,2.11,2.11,0,0,0-1.9,1.2,29.54,29.54,0,0,1-5.7,6.6,1.45,1.45,0,0,1-.7.2M54.6,90.1a1.09,1.09,0,0,1-.9-.4,1.16,1.16,0,0,1,.2-1.7,29.17,29.17,0,0,1,4.5-3,1.19,1.19,0,1,1,1.1,2.1,35.24,35.24,0,0,0-4,2.7,1.9,1.9,0,0,1-.9.3M85.2,78.7c.5.4,1,.3,1.6-.2a45,45,0,0,0,8.5-11.3,1.12,1.12,0,0,1,1.4-.7c.7.3.7,1.4.1,2.7a44,44,0,0,1-8.3,11.6,1,1,0,0,0,0,1.4c.4.4,1,.3,1.6-.3a48.69,48.69,0,0,0,5.2-6,1.13,1.13,0,0,1,1.2-.6c.6.1.7.7.5,1.3-.3,1.1-3.4,5.1-4.6,6.4-3.3,3.7-6.6,5.7-13,8.9-2.2,1.1-3.9,2.2-4.9,3.9-.9,1.5-1.2,2-1.3,2.2a1.42,1.42,0,0,0,.7,2,1.27,1.27,0,0,0,.6.1,1.51,1.51,0,0,0,1.4-.9l1.1-2a8.74,8.74,0,0,1,3.7-3.3,37.77,37.77,0,0,0,12.7-8.8A42.16,42.16,0,0,0,98,78.8c1.8-3,.8-5.5-.8-5.9a.19.19,0,0,1-.1-.3,16,16,0,0,0,2-4.7c.3-1.5-.1-3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0,0,0,.5,0Zm-1.3,2.3c0-.2-.3-.3-.4-.3-.9-.2-4.6-.7-5.4-.8-.4,0-.6.2-.6.4a6.05,6.05,0,0,0,.1,1.8,5.85,5.85,0,0,0,.5,1.7.48.48,0,0,0,.7.2c.7-.3,4.1-2.1,4.8-2.6.1,0,.3-.1.3-.4ZM90.1,93c-.2,0-.3.2-.4.4-.3.8-1.2,4.5-1.4,5.3a.53.53,0,0,0,.4.7,8.16,8.16,0,0,0,1.8.1,5.94,5.94,0,0,0,1.8-.3c.3-.1.4-.3.3-.7a31.15,31.15,0,0,0-2.1-5c0-.3-.1-.5-.4-.5Zm2.2-1.7a.44.44,0,0,0,.1.5,46.83,46.83,0,0,0,3.8,3.9.52.52,0,0,0,.8,0,5.4,5.4,0,0,0,1-1.5,12.83,12.83,0,0,0,.7-1.6c0-.3-.1-.5-.5-.6-.8-.2-4.5-.8-5.4-.9-.2,0-.4,0-.5.2Z"

d="M80,65.38l2.62,5.3a2.27,2.27,0,0,0,1.69,1.23l5.85.85a2.25,2.25,0,0,1,1.25,3.84l-4.23,4.12a2.24,2.24,0,0,0-.65,2l1,5.83a2.25,2.25,0,0,1-3.27,2.37L79,88.16a2.27,2.27,0,0,0-2.09,0l-5.23,2.75a2.25,2.25,0,0,1-3.27-2.37l1-5.83a2.24,2.24,0,0,0-.65-2L64.51,76.6a2.25,2.25,0,0,1,1.25-3.84l5.85-.85a2.27,2.27,0,0,0,1.69-1.23l2.62-5.3A2.25,2.25,0,0,1,80,65.38Z"

Incline SVG like this makes the page code huge and CPU time would be spent onto parsing the huge payload, blocking the page from interactive. We should consider splitting the svg code or this component into separated files to reduce blocking.

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

1 participant