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

Unified Diff: sky/benchmarks/dom/creation.sky

Issue 1216823002: Remove sky/benchmarks (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | sky/benchmarks/layout/simple-blocks.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/benchmarks/dom/creation.sky
diff --git a/sky/benchmarks/dom/creation.sky b/sky/benchmarks/dom/creation.sky
deleted file mode 100644
index 7076a7e064ad210bd9a0b26b7fee276cee109a0f..0000000000000000000000000000000000000000
--- a/sky/benchmarks/dom/creation.sky
+++ /dev/null
@@ -1,94 +0,0 @@
-<sky>
-<import src="../resources/runner.sky" as="PerfRunner" />
-<script>
-var sky = document.querySelector("sky");
-
-var widgets = 0;
-var basicElements = 0;
-var texts = 0;
-
-var WidgetPrototype = Object.create(HTMLElement.prototype);
-WidgetPrototype.createdCallback = function() {
- widgets++;
- this.wasCreated = true;
- this.wasAttached = false;
- this.wasDetached = false;
- this.attrsChanged = [];
- this.ensureShadowRoot();
-};
-
-WidgetPrototype.attachedCallback = function() {
- this.wasAttached = true;
-};
-
-WidgetPrototype.detachedCallback = function() {
- this.wasDetached = true;
-};
-
-WidgetPrototype.attributeChangedCallback = function(name, oldValue, newValue) {
- this.attrsChanged.push({
- name: name,
- oldValue: oldValue,
- newValue: newValue,
- });
-};
-
-var Widget = document.registerElement("x-widget", {
- prototype: WidgetPrototype,
-});
-
-function createElement(tagName) {
- basicElements++;
- return document.createElement(tagName);
-}
-
-function createText(text) {
- texts++;
- return new Text(text);
-}
-
-function createElements(root, depth) {
- for (var i = 0; i < 4; i++) {
- var div = createElement("div");
- var span1 = div.appendChild(createElement("span"));
- span1.appendChild(createText("foo"));
- span1.setAttribute("id", "span" + (i * depth));
- div.appendChild(createText(" "));
- div.setAttribute("class", "b" + i + " a" + i);
- var span2 = div.appendChild(createElement("span"));
- span2.appendChild(createText("bar"));
- var widget = span2.appendChild(new Widget());
- widget.setAttribute("id", "widget-" + (i * depth));
- widget.setAttribute("custom", "example attribute");
- widget.setAttribute("custom2", "example attribute2");
- root.appendChild(div);
- if (depth)
- createElements(widget.shadowRoot, depth - 1);
- }
-}
-
-var runner = new PerfRunner({
- setup: function() {
- widgets = 0;
- basicElements = 0;
- texts = 0;
- },
- iterations: 10,
- unit: "ms",
-});
-
-runner.runAsync(function(done) {
- var root = createElement("div");
- sky.appendChild(root);
- createElements(root, 3);
- root.remove();
- // console.log("widgets: " + widgets);
- // console.log("basic elements: " + basicElements);
- // console.log("texts: " + texts);
- // CONSOLE: LOG: widgets: 340
- // CONSOLE: LOG: basic elements: 1021
- // CONSOLE: LOG: texts: 1020
- done();
-});
-</script>
-</sky>
« no previous file with comments | « no previous file | sky/benchmarks/layout/simple-blocks.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698