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

Low support for SVG icons #1869

Closed
vizath opened this issue Oct 13, 2015 · 3 comments
Closed

Low support for SVG icons #1869

vizath opened this issue Oct 13, 2015 · 3 comments
Labels
component: SvgIcon The React component.

Comments

@vizath
Copy link
Contributor

vizath commented Oct 13, 2015

As specified in #1475, there seems to have a performance drawback using SVG icons over fonts. I'd like to know, is there any benchmarks done for this ?

Also, why is there so much poor support for SVG icons in general (doc, components, etc). There is no easy way to go get icons from the base object (require('material-ui')) and components like Toolbar or DropDownIcon do not even support SVG icons, only FontIcon.

@vizath
Copy link
Contributor Author

vizath commented Oct 14, 2015

I did some benchmarks: http://imgur.com/a/h4KL2

After a few retries, numbers seems to average to:

svg initial load time (evaluate script): 900ms
svg render time (inserting DOM): 750ms
svg paint finished after: 50ms

css initial load time (evaluate script): 900ms
css render time (inserting DOM): 650ms
css paint finished after: 500ms (includes the time to load the font)

// if ttf is already loaded
css initial load time (evaluate script): 900ms
css render time (inserting DOM): 450ms
css paint finished after: 300ms

It doesn't seem to take more time to load the page, the single http request for fonts is not a bottleneck in the test.
It seems to take a bit more time adding <svg> elements to the DOM than <span>
The time between the inserted DOM and the final render of the actual icons is way faster in SVG than it is with fonts when the font is not already loaded.
When the font is already loaded, the full render time seems to be equivalent.
Note: No production optimizations where done.

Other than performance, I think that SVG icons are more easily maintainable.

I'd like to have your thoughts on this.
I can publish my test cases if needed.

@oliviertassinari
Copy link
Member

@vizath Interesting benchmark!

Other than performance, I think that SVG icons are more easily maintainable.

I agree

@mbrookes
Copy link
Member

mbrookes commented Feb 2, 2016

Docs are updated, DropDownIcon is deprecated, and SVP icon performance we have no control over 😄. Hope that covers it, but please reopen if not.

@mbrookes mbrookes closed this as completed Feb 2, 2016
@zannager zannager added the component: SvgIcon The React component. label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: SvgIcon The React component.
Projects
None yet
Development

No branches or pull requests

4 participants