-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add performance test for binding-expressions
- Loading branch information
1 parent
423074d
commit 42f7d78
Showing
2 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> | ||
<script src="../../bower_components/perf-tester/perf.js"></script> | ||
<script src="../../bower_components/webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
</head> | ||
|
||
<body> | ||
|
||
<!-- <template> | ||
{{compute(alaksjflkasjflkasjflkasjlfkajslkfjaslkfjaaaaaaaaaaaaaaaaaaaaaaaa)]} | ||
</template> | ||
--> <!-- {{compute(tricky, 'literal\,\'zot\'', this.has.long.log.lo)]} --> | ||
|
||
<template> | ||
<span>{{foo}}</span> <span>{{foo.bar}}</span> <span>{{foo.bar.zot}}</span> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | ||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
<span>{{compute(tricky, 'literal\,\'zot\'')}}</span> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | ||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
<span>{{compute(tricky, 'literal\,\'zot\'', this.has.a.bogus.ending.bracket)]}</span> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | ||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
<div class$="{{compute(a, b, c,d,e,f,g,h,i)}}"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | ||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
<span>{{bindings.and.stuff}}</span> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
<div id="zot"><span>[[computeFn(a, 'b', c, "d", 999)]]</span> literal <span>{{a.b}}</span> literally</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
var COUNT = 1000; | ||
var templates = []; | ||
var template = document.querySelector('template'); | ||
for (var i=0; i<COUNT; i++) { | ||
templates[i] = template.cloneNode(true); | ||
} | ||
console.perf(); | ||
for (var i=0; i<COUNT; i++) { | ||
const klass = Polymer({ | ||
is: 'test-el-' + i, | ||
_template: templates[i] | ||
}); | ||
new klass(); | ||
} | ||
console.perfEnd(); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
|
||
<meta charset="utf-8"> | ||
<script src="../../bower_components/webcomponentsjs/webcomponents-lite.js"></script> | ||
<script src="../../bower_components/perf-tester/perf-tester.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
<style> | ||
summary { | ||
font-family: sans-serif; | ||
font-size: 1.5em; | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<summary>Perf is go.</summary> | ||
<perf-tester runs="25"></perf-tester> | ||
|
||
<script> | ||
document.querySelector('perf-tester').tests = [ | ||
'binding-expressions.html' | ||
]; | ||
</script> | ||
|
||
</body> |