jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
The goal is to see which method runs faster when manipulating several LI nodes within an UL node, specially cleaning UL and adding new nodes vs reusing existing nodes.
<script src="http://yui.yahooapis.com/combo?3.4.1/build/yui/yui-min.js&3.4.1/build/oop/oop-min.js&3.4.1/build/event-custom-base/event-custom-base-min.js&3.4.1/build/dom-core/dom-core-min.js&3.4.1/build/dom-base/dom-base-min.js&3.4.1/build/selector-native/selector-native-min.js&3.4.1/build/selector/selector-min.js&3.4.1/build/node-core/node-core-min.js&3.4.1/build/node-base/node-base-min.js&3.4.1/build/event-base/event-base-min.js&3.4.1/build/event-delegate/event-delegate-min.js&3.4.1/build/node-event-delegate/node-event-delegate-min.js&3.4.1/build/pluginhost-base/pluginhost-base-min.js&3.4.1/build/pluginhost-config/pluginhost-config-min.js&3.4.1/build/node-pluginhost/node-pluginhost-min.js&3.4.1/build/dom-style/dom-style-min.js&3.4.1/build/dom-screen/dom-screen-min.js&3.4.1/build/node-screen/node-screen-min.js&3.4.1/build/node-style/node-style-min.js&3.4.1/build/event-custom-complex/event-custom-complex-min.js&3.4.1/build/intl/intl-min.js"></script>
<ul id="foo">
<li>bar</li>
<li>baz</li>
</ul>
<script>
var aux,
Y = YUI().use('node'),
foo = Y.one('#foo'),
bar = Y.Node.create('<li>bar</li>'),
baz = Y.Node.create('<li>baz</li>'),
node1 = foo.one('li'),
node2 = foo.one('> li:last-of-type');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
2 append string |
| ready |
1 append string |
| ready |
2 append node create |
| ready |
1 append node create |
| ready |
2 append clone node |
| ready |
set content string |
| ready |
insert before selectors css3 |
| ready |
insert before selectors |
| ready |
insert before node pointers |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.