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

Unified Diff: sky/benchmarks/layout/simple-blocks.html

Issue 701813004: Add a microbenchmark for simple block layout (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fixenated Created 6 years, 1 month 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/resources/runner.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/benchmarks/layout/simple-blocks.html
diff --git a/sky/benchmarks/layout/simple-blocks.html b/sky/benchmarks/layout/simple-blocks.html
new file mode 100644
index 0000000000000000000000000000000000000000..094f763b10376d9baa4926403d94fa77be1db1c5
--- /dev/null
+++ b/sky/benchmarks/layout/simple-blocks.html
@@ -0,0 +1,44 @@
+<sky>
+<import src="../resources/runner.sky" as="PerfRunner" />
+<style>
+div {
+ height: 10px;
+}
+span {
+ display: inline;
+}
+</style>
+<div id='content'></div>
+<script>
+var content = document.getElementById('content');
+
+var out = [];
+for (var i = 0; i < 1000; i++) {
+ var div = document.createElement('div');
+ div.appendChild(document.createElement('span')).appendChild(document.createTextNode('foo'));
+ div.appendChild(document.createTextNode(' '));
+ div.appendChild(document.createElement('span')).appendChild(document.createTextNode('bar'));
+ content.appendChild(div);
+}
+
+var b = document.querySelector('sky');
+
+var runner = new PerfRunner({
+ setup: function() {
+ b.style.width = '210px';
+ getComputedStyle(b).color;
+ b.offsetHeight;
+
+ b.style.width = '200px';
+ getComputedStyle(b).color;
+ },
+ iterations: 10,
+ unit: 'ms',
+});
+
+runner.runAsync(function(done) {
+ b.offsetHeight;
+ done();
+});
+</script>
+</sky>
« no previous file with comments | « no previous file | sky/benchmarks/resources/runner.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698