get/setAttribute vs. jqmData
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://babulina.go-nix.ca/nix/buttonMarkup.js"></script>
<script>
$template = $("<a href='#' data-role='button'>");
$container = $( "#container" );
</script>
<div id="container"></div>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
1. Original |
|
pending… |
2. Native |
|
pending… |
3. More improvements |
|
pending… |
0. Using .attr() |
|
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 Gabriel Schulhof
- Revision 2: published by Gabriel Schulhof
- Revision 3: published by Gabriel Schulhof
- Revision 4: published by Gabriel Schulhof
- Revision 5: published by Gabriel Schulhof
- Revision 6: published by Gabriel Schulhof
- Revision 7: published by Gabriel Schulhof
0 comments