Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

It has been discovered that the virtual DOM implementation in Elm 0.16 (which is based on virtual-dom) can misbehave in a couple of edge cases.

The root cause behind this is the ambiguity around what JS property (aka. IDL attribute) values would result in the removal of the actual DOM attributes.

These tests have been created to shed some light on the performance implications of choosing the DOM attributes' interface (which always works predictably) over JavaScript properties (which can cause undesired behavior).

Usage

Open index.html in the browser of your choice. Click the button and wait for the results. The tests use benchmark.js under the hood.

Reading the results

A DOM attribute API operation looks like this:

var hiddenRow = document.getElementById('hiddenRow');
hiddenRow.removeAttribute("hidden");
hiddenRow.setAttribute("hidden", "hidden");

A JS property operation looks like this:

var hiddenRow = document.getElementById('hiddenRow');
hiddenRow.hidden = "";
hiddenRow.hidden = "true";

A "mixed" operation looks like this:

var hiddenRow = document.getElementById('hiddenRow');
hiddenRow.removeAttribute("hidden");
hiddenRow.hidden = "true";

About

Measure the performance implications of using JavaScript properties (IDL attributes) vs. the DOM attributes' interface.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages