Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: third_party/WebKit/PerformanceTests/ShadowDOM/v1-slot-append.html

Issue 1995203002: Rewrite Shadow DOM distribution engine to support partial synchronous distribution for v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No longer FAIL: imported/wpt/shadow-dom/HTMLSlotElement-interface.html Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/PerformanceTests/ShadowDOM/v1-slot-append.html
diff --git a/third_party/WebKit/PerformanceTests/ShadowDOM/v1-slot-append.html b/third_party/WebKit/PerformanceTests/ShadowDOM/v1-slot-append.html
new file mode 100644
index 0000000000000000000000000000000000000000..84ba432e12b6d25b98812479afa2e12a1d38e2bb
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/ShadowDOM/v1-slot-append.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<script src="../resources/runner.js"></script>
+<!-- This is a micro benchmark to catch an unintentional regression.
+ If the reason of a regression is clear, it is okay.
+ We do not have to optimize the result of the benchmark. -->
+<div id="wrapper">
+ <div id="host"></div>
+</div>
+<script>
+'use strict';
+const numChildOfHost = 20;
+const numDivsInShadow = 20;
+const loops = 100;
+
+const slot1 = document.createElement('slot');
+slot1.setAttribute('name', 'slot1');
+const slot2 = document.createElement('slot');
+slot2.setAttribute('name', 'slot2');
+const shadowRoot = host.attachShadow({mode: 'open'});
+shadowRoot.appendChild(slot1);
+shadowRoot.appendChild(slot2);
+
+for (let i = 0; i < numDivsInShadow; ++i) {
+ let div = document.createElement('div');
+ shadowRoot.appendChild(div);
+}
+
+for (let i = 0; i < numChildOfHost; ++i) {
+ let div1 = document.createElement('div');
+ div1.setAttribute('slot', 'slot1');
+ host.appendChild(div1);
+ let div2 = document.createElement('div');
+ div2.setAttribute('slot', 'slot2');
+ host.appendChild(div2);
+}
+
+function run() {
+ for (let i = 0; i < loops; ++i) {
+ const slot3 = document.createElement('slot');
+ slot1.setAttribute('name', 'slot3');
+ const slot4 = document.createElement('slot');
+ slot1.setAttribute('name', 'slot1');
+ slot3.remove();
+ slot4.remove();
+ }
+}
+
+PerfTestRunner.measureRunsPerSecond({
+ description: "Measure v1 distribution performance",
+ run: run,
+ done: () => {
+ wrapper.innerHTML = '';
+ }
+});
+</script>
« no previous file with comments | « third_party/WebKit/PerformanceTests/ShadowDOM/v1-host-child-append.html ('k') | third_party/WebKit/PerformanceTests/Skipped » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698