Data Attribute vs Dataset

Benchmark created on


Preparation HTML

<div id="testHost" data-upload-event="uploadFiles"></div>

Setup

var testHost = document.getElementById("testHost");

Test runner

Ready to run.

Testing in
TestOps/sec
Get Attribute
var a = testHost.getAttribute("data-upload-event");
ready
Dataset
var b = testHost.dataset.uploadEvent;
ready

Revisions

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