Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
slug5573
(version: 0)
Comparing performance of:
prim_first_child vs prim_not_ghost vs defs_g vs _not_ghost
Created:
9 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<svg><g id="ixlo9b2riw3" class="Group.cls" transform="translate(50 50)"><g id="ixlo1aofdbb" transform="translate(0 165.00000000000003)"><path d="M 0 22 L 68.75 44 L 481.25000000000006 44 L 550 22 L 486.75000000000006 11 L 363.00000000000006 0 L 187.00000000000003 0 L 63.25000000000001 11 z" fill="#19486F" stroke="#19486F"></path><path d="M 0 22 L 68.75 44 L 481.25000000000006 44 L 550 22 L 486.75000000000006 11 L 363.00000000000006 0 L 187.00000000000003 0 L 63.25000000000001 11 z" fill="#19486F" stroke="#19486F" class="Ghost.cls" display="none"></path></g><g id="ixlo09bcc6w" transform="translate(3.552713678800501e-15 55.000000000000014)"><path d="M 62.50018692016602 0 L 62.56250000000001 121.00000000000001 L 0 132 L 0.00018692016576338238 66.00000000000004 z" fill="#19486F" stroke="#19486F"></path><path d="M 62.50018692016602 0 L 62.56250000000001 121.00000000000001 L 0 132 L 0.00018692016576338238 66.00000000000004 z" fill="#19486F" stroke="#19486F" class="Ghost.cls" display="none"></path></g><g id="ixlnuw196yq" transform="translate(487.4375 55.000000000000014)"><path d="M 0.06231307983398438 0 L 0 121.00000000000001 L 62.56250000000001 132 L 62.56231307983424 66.00000000000004 z" fill="#2E73B8" stroke="#2E73B8"></path><path d="M 0.06231307983398438 0 L 0 121.00000000000001 L 62.56250000000001 132 L 62.56231307983424 66.00000000000004 z" fill="#2E73B8" stroke="#2E73B8" class="Ghost.cls" display="none"></path></g><g id="ixlnuw196yp" transform="translate(362.3125000000002 0)"><path d="M 0.18735885620100057 0 L 0 165 L 124.4375 176 L 125.1873588562013 55 z" fill="#5294CF" stroke="#5294CF"></path><path d="M 0.18735885620100057 0 L 0 165 L 124.4375 176 L 125.1873588562013 55 z" fill="#5294CF" stroke="#5294CF" class="Ghost.cls" display="none"></path></g><g id="ixlnyp6q9o8" transform="translate(62.5625000000079 0)"><path d="M 125.00000000000075 0 L 125.18735885620173 165 L 0.7498588562017509 176 L 4.263256414560601e-13 55 z" fill="#205B99" stroke="#205B99"></path><path d="M 125.00000000000075 0 L 125.18735885620173 165 L 0.7498588562017509 176 L 4.263256414560601e-13 55 z" fill="#205B99" stroke="#205B99" class="Ghost.cls" display="none"></path></g><g id="ixlnuw196yo" transform="translate(187.49997949600072 0)"><rect fill="#2E73B8" height="165" stroke="#2E73B8" width="175.0000366210932" x="0" y="0"></rect><rect fill="#2E73B8" height="165" stroke="#2E73B8" width="175.0000366210932" x="0" y="0" class="Ghost.cls" display="none"></rect></g><g id="ixlo2ocdezr" transform="translate(0 341.00000000000006)"><path d="M 0 22 L 68.75 0 L 481.25000000000006 0 L 550 22 L 486.75000000000006 33 L 363.00000000000006 44 L 187.00000000000003 44 L 63.25000000000001 33 z" fill="#99BCE3" stroke="#99BCE3"></path><path d="M 0 22 L 68.75 0 L 481.25000000000006 0 L 550 22 L 486.75000000000006 33 L 363.00000000000006 44 L 187.00000000000003 44 L 63.25000000000001 33 z" fill="#99BCE3" stroke="#99BCE3" class="Ghost.cls" display="none"></path></g><g id="ixlo2ocdezs" transform="translate(3.552713678800501e-15 363.00000000000006)"><path d="M 62.50018692016602 132 L 62.56250000000001 11 L 0 0 L 0.00018692016576338257 65.99999999999997 z" fill="#19486F" stroke="#19486F"></path><path d="M 62.50018692016602 132 L 62.56250000000001 11 L 0 0 L 0.00018692016576338257 65.99999999999997 z" fill="#19486F" stroke="#19486F" class="Ghost.cls" display="none"></path></g><g id="ixlo2oceezt" transform="translate(487.4375 363.00000000000006)"><path d="M 0.0623130798339844 132 L 0 11 L 62.56250000000001 0 L 62.56231307983424 65.99999999999997 z" fill="#2E73B8" stroke="#2E73B8"></path><path d="M 0.0623130798339844 132 L 0 11 L 62.56250000000001 0 L 62.56231307983424 65.99999999999997 z" fill="#2E73B8" stroke="#2E73B8" class="Ghost.cls" display="none"></path></g><g id="ixlo2oceezu" transform="translate(362.3125000000002 374.00000000000006)"><path d="M 0.18735885620100057 176 L 0 11 L 124.4375 0 L 125.1873588562013 121.00000000000006 z" fill="#5294CF" stroke="#5294CF"></path><path d="M 0.18735885620100057 176 L 0 11 L 124.4375 0 L 125.1873588562013 121.00000000000006 z" fill="#5294CF" stroke="#5294CF" class="Ghost.cls" display="none"></path></g><g id="ixlo2oceezv" transform="translate(62.5625000000079 374.00000000000006)"><path d="M 125.00000000000075 176 L 125.18735885620173 11 L 0.7498588562017509 0 L 4.263256414560601e-13 121.00000000000006 z" fill="#205B99" stroke="#205B99"></path><path d="M 125.00000000000075 176 L 125.18735885620173 11 L 0.7498588562017509 0 L 4.263256414560601e-13 121.00000000000006 z" fill="#205B99" stroke="#205B99" class="Ghost.cls" display="none"></path></g><g id="ixlo2ocfezw" transform="translate(187.49997949600072 385.00000000000006)"><rect fill="#2E73B8" height="165" stroke="#2E73B8" width="175.0000366210932" x="0" y="0"></rect><rect fill="#2E73B8" height="165" stroke="#2E73B8" width="175.0000366210932" x="0" y="0" class="Ghost.cls" display="none"></rect></g><g id="ixlo59wtgjk" transform="translate(343.75000000000006 193.6)"><path d="M 96.25000000000001 6.600000000000001 L 0 0 L 0 162.80000000000004 L 96.25000000000001 156.20000000000005 z" fill="#5294CF" stroke="#5294CF"></path><path d="M 96.25000000000001 6.600000000000001 L 0 0 L 0 162.80000000000004 L 96.25000000000001 156.20000000000005 z" fill="#5294CF" stroke="#5294CF" class="Ghost.cls" display="none"></path></g><g id="ixlo3x2eg3a" transform="translate(206.25 193.5999908447282)"><rect fill="#2E73B8" height="162.80001678466792" stroke="#2E73B8" width="137.5" x="0" y="0"></rect><rect fill="#2E73B8" height="162.80001678466792" stroke="#2E73B8" width="137.5" x="0" y="0" class="Ghost.cls" display="none"></rect></g><g id="ixlo8j1siiq" transform="translate(110 193.6)"><path d="M 0 6.600000000000001 L 96.25000000000001 0 L 96.25000000000001 162.80000000000004 L 0 156.20000000000005 z" fill="#205B99" stroke="#205B99"></path><path d="M 0 6.600000000000001 L 96.25000000000001 0 L 96.25000000000001 162.80000000000004 L 0 156.20000000000005 z" fill="#205B99" stroke="#205B99" class="Ghost.cls" display="none"></path></g></g></svg>
Script Preparation code:
var $main = $('#ixlo9b2riw3');
Tests:
prim_first_child
var x = $main.children('rect:first-child, ellipse:first-child, path:first-child');
prim_not_ghost
var x = $main.children('rect:not(.Ghost\\.cls), ellipse:not(.Ghost\\.cls), path:not(.Ghost\\.cls)');
defs_g
var x = $main.children(':not(defs, g)');
_not_ghost
var x = $main.children('rect, ellipse, path').not('.Ghost\\.cls');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
prim_first_child
prim_not_ghost
defs_g
_not_ghost
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
A challenging benchmarking problem! After analyzing the provided SVG code and test cases, I'll provide an answer based on my understanding of SVG parsing and JavaScript performance. **Question:** What is the approximate number of DOM nodes that need to be traversed for each benchmark case? **Answer:** 1. **prim_first_child**: The first child node is a `path` element with an ID of "ixlo3x2eg3a". It has two child elements: a `rect` and an `ellipse`. Therefore, the number of DOM nodes to traverse is 3 (the path itself + its two children). 2. **prim_not_ghost**: The `not(.Ghost.cls)` selector will skip all elements with class "Ghost.cls". In this case, there are three such elements: a `path`, a `rect`, and an `ellipse`. Therefore, the number of DOM nodes to traverse is 4 (the path + its two children). 3. **defs_g**: The `:not(defs, g)` selector will skip all elements with `def`s or `g` tags. In this case, there are no such elements, so only the root element needs to be traversed, which is 1. 4. **_not_ghost**: Similar to **prim_not_ghost**, but without the first child node, resulting in 2 DOM nodes to traverse (the path + its second child). **Assumptions:** * The SVG code and test cases are representative of the actual benchmarks. * The JavaScript engine being used is capable of efficiently parsing the SVG code and traversing the DOM. **Conclusion:** The number of DOM nodes to traverse for each benchmark case seems to be related to the complexity of the SVG structure. The cases with more child elements require more DOM node traversals, which likely affects performance.
Related benchmarks:
slug5573
slug5573
slug5573
Path2d vs drawImage(svg)
Comments
Confirm delete:
Do you really want to delete benchmark?