-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Iterating over a large HTMLCollection is slow #36609
Copy link
Copy link
Open
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentI-perf-slowUnnecessary performance degredation.Unnecessary performance degredation.
Description
From the testcase in #36480, this snippet takes ~5s to execute in a release build:
let timestamps = document.getElementsByTagName("time");
for(let r of timestamps) {
let dt = new Date(parseInt(r.getAttribute("ms")));
dt.setMinutes(dt.getMinutes() - dt.getTimezoneOffset())
r.innerText = dt.toISOString().slice(0, 19).replace("T", " ");
}Surprisingly, one of the biggest contributors to the profile on macOS is the assert_in_script function; specifically style::thread_state::get().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentI-perf-slowUnnecessary performance degredation.Unnecessary performance degredation.