new Audio() vs. document.createElement('audio') (v3)

Revision 3 of this benchmark created on


Description

Testing the performance between new Audio(), jQuery way, and document.createElement('audio').

Preparation HTML

<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
new Audio
var a = new Audio('http://upload.wikimedia.org/wikipedia/commons/4/47/Beethoven_Moonlight_2nd_movement.ogg');
ready
createElement
var b = document.createElement('audio');
b.src = 'http://upload.wikimedia.org/wikipedia/commons/4/47/Beethoven_Moonlight_2nd_movement.ogg';
ready
jQuery
jQuery('<audio>').prop('src', 'http://upload.wikimedia.org/wikipedia/commons/4/47/Beethoven_Moonlight_2nd_movement.ogg');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.