attributes vs datasets
JavaScript performance comparison
Preparation code
<div id="elem2" data-name="le second test"></div>
<script>
var elem = document.createElement('div'),
elem2 = document.getElementById('elem2')
elem.setAttribute('data-name', 'le test')
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
dataset |
|
pending… |
attribute |
|
pending… |
dataset in dom |
|
pending… |
attribute in dom |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by davsket
- Revision 2: published by davsket
0 comments