Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
inline svg vs div-2
(version: 1)
Comparing performance of: Inline SVG vs Div
Comparing performance of:
inline svg vs div
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<svg className="container" xmlns="http://www.w3.org/2000/svg" style="position: absolute; width: 0; height: 0" width="0" height="0"> <defs> <symbol id="umbrella" viewBox="0 0 32 32"> <path d="M0 48C0 21.5 21.5 0 48 0H176c26.5 0 48 21.5 48 48V176c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48zm288 0c0-26.5 21.5-48 48-48H464c26.5 0 48 21.5 48 48V176c0 26.5-21.5 48-48 48H336c-26.5 0-48-21.5-48-48V48zm48 240H464c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H336c-26.5 0-48-21.5-48-48V336c0-26.5 21.5-48 48-48zM0 336c0-26.5 21.5-48 48-48H176c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V336zM416 64c0-8.8-7.2-16-16-16s-16 7.2-16 16V96H352c-8.8 0-16 7.2-16 16s7.2 16 16 16h32v32c0 8.8 7.2 16 16 16s16-7.2 16-16V128h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H416V64zM64 96c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H64zM83.3 348.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L89.4 400 60.7 428.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L112 422.6l28.7 28.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L134.6 400l28.7-28.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L112 377.4 83.3 348.7zM352 352c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H352zm0 64c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H352z"></path> </symbol> </defs> </svg> <script src="https://unpkg.com/react@16/umd/react.production.min.js" crossorigin></script> <script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js" crossorigin></script> <div id="main"></div>
Script Preparation code:
var SVGInline = function() { return React.createElement( "svg", { className: "office", xmlns: "http://www.w3.org/2000/svg", width: 190, height: 190, viewBox: "0 0 188.5 188.5", dangerouslySetInnerHTML: { __html: '<path d="M0 48C0 21.5 21.5 0 48 0H176c26.5 0 48 21.5 48 48V176c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48zm288 0c0-26.5 21.5-48 48-48H464c26.5 0 48 21.5 48 48V176c0 26.5-21.5 48-48 48H336c-26.5 0-48-21.5-48-48V48zm48 240H464c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H336c-26.5 0-48-21.5-48-48V336c0-26.5 21.5-48 48-48zM0 336c0-26.5 21.5-48 48-48H176c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V336zM416 64c0-8.8-7.2-16-16-16s-16 7.2-16 16V96H352c-8.8 0-16 7.2-16 16s7.2 16 16 16h32v32c0 8.8 7.2 16 16 16s16-7.2 16-16V128h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H416V64zM64 96c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H64zM83.3 348.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L89.4 400 60.7 428.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L112 422.6l28.7 28.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L134.6 400l28.7-28.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L112 377.4 83.3 348.7zM352 352c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H352zm0 64c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H352z"></path>' } }, ); } var DivTest = function() { return React.createElement( "div", { className: "office", width: 190, height: 190, }, "Foo" ); }
Tests:
inline svg
ReactDOM.render(React.createElement(SVGInline, null), document.querySelector("#main"));
div
ReactDOM.render(React.createElement(DivTest, null), document.querySelector("#main"));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
inline svg
div
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
inline svg
517508.7 Ops/sec
div
562069.9 Ops/sec
Related benchmarks:
svg inline vs use
inline svg vs div
svg dangerouslySetInnerHTML vs use vs inline
dadsdsad
React svg inline vs use 500x
inline svg vs divas
Div vs SVG (Flavio)
SVG vs DIV Performance
inline svg vs div-2-ayr
Comments
Confirm delete:
Do you really want to delete benchmark?