-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(compiler): use comment to mark target (#1774)
- Loading branch information
Showing
22 changed files
with
855 additions
and
110 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
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,66 @@ | ||
import { Aurelia, CustomElement, StandardConfiguration } from '@aurelia/runtime-html'; | ||
import { createItems } from './utils/data.js'; | ||
|
||
let $count = 0; | ||
|
||
const App = CustomElement.define({ | ||
name: 'app', | ||
template: '<div>' | ||
+ '<div><div repeat.for="i of 10">Col ${i}</div></div></div>' | ||
+ '<div repeat.for="i of items">' | ||
+ '<p>Cell <var>${i}</var></p>' | ||
+ '<p>Cell <strong>${i}</strong></td>' | ||
+ '<p>Cell <b>${i}</b></p>' | ||
+ '<p>Cell <span>${i}</span></p>' | ||
+ '<p>Cell <div>${i}</div></p>' | ||
|
||
+ '<p>Cell <var>${i}</var></p>' | ||
+ '<p>Cell <strong>${i}</strong></td>' | ||
+ '<p>Cell <b>${i}</b></p>' | ||
+ '<p>Cell <span>${i}</span></p>' | ||
+ '<p>Cell <div>${i}</div></p>' | ||
|
||
+ '<p>Cell <var>${i}</var></p>' | ||
+ '<p>Cell <strong>${i}</strong></td>' | ||
+ '<p>Cell <b>${i}</b></p>' | ||
+ '<p>Cell <span>${i}</span></p>' | ||
+ '<p>Cell <div>${i}</div></p>' | ||
|
||
+ '<p>Cell <var>${i}</var></p>' | ||
+ '<p>Cell <strong>${i}</strong></td>' | ||
+ '<p>Cell <b>${i}</b></p>' | ||
+ '<p>Cell <span>${i}</span></p>' | ||
+ '<p>Cell <div>${i}</div></p>' | ||
|
||
+ '<p>Cell <var>${i}</var></p>' | ||
+ '<p>Cell <strong>${i}</strong></td>' | ||
+ '<p>Cell <b>${i}</b></p>' | ||
+ '<p>Cell <span>${i}</span></p>' | ||
+ '<p>Cell <div>${i}</div></p>' | ||
+ '</div>' | ||
+ '</div>' | ||
}, class { | ||
constructor() { | ||
this.newItems($count); | ||
} | ||
|
||
newItems(count, seed = 0) { | ||
this.items = createItems(count, seed); | ||
} | ||
|
||
updateItems() { | ||
const count = this.items.length; | ||
this.items.forEach((i, idx) => i.update(count - idx + 1)) | ||
} | ||
}); | ||
|
||
export const start = (host, count = 0) => { | ||
$count = count; | ||
const au = new Aurelia().register(StandardConfiguration).app({ | ||
component: App, | ||
host | ||
}); | ||
au.start(); | ||
|
||
return au; | ||
}; |
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
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
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
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,28 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/Polymer/tachometer/master/config.schema.json", | ||
"root": "../../", | ||
|
||
"benchmarks": [ | ||
{ | ||
"browser": { | ||
"name": "chrome", | ||
"headless": true, | ||
"addArguments": ["--js-flags=--expose-gc", "--enable-precise-memory-info"] | ||
}, | ||
"measurement": [ | ||
{ "name": "perf", "mode": "performance", "entryName": "rerender1k-big-template" } | ||
], | ||
"expand": [ | ||
{ | ||
"name": "rerender 1k latest (big template)", | ||
"url": "rerender1k-latest-big-template.html" | ||
}, | ||
{ | ||
"name": "rerender 1k local (big template)", | ||
"url": "rerender1k-local-big-template.html" | ||
} | ||
] | ||
} | ||
], | ||
"timeout": 0.5 | ||
} |
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,17 @@ | ||
<script type="module"> | ||
import { start } from './latest/dist/app-big-template.latest.js'; | ||
|
||
const host = document.body.appendChild(document.createElement('div')); | ||
const au = start(host); | ||
performance.mark('1k-start'); | ||
|
||
au.root.controller.viewModel.newItems(500); | ||
|
||
performance.mark('1k-end'); | ||
|
||
// measure memory in MBs | ||
window.jsHeapSize = performance.memory.usedJSHeapSize / 1e6; | ||
|
||
performance.measure('rerender1k-big-template', '1k-start', '1k-end'); | ||
|
||
</script> |
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,16 @@ | ||
<script type="module"> | ||
import { start } from './local/dist/app-big-template.local.js'; | ||
|
||
const host = document.body.appendChild(document.createElement('div')); | ||
const au = start(host); | ||
performance.mark('1k-start'); | ||
|
||
au.root.controller.viewModel.newItems(500); | ||
|
||
performance.mark('1k-end'); | ||
|
||
// measure memory in MBs | ||
window.jsHeapSize = performance.memory.usedJSHeapSize / 1e6; | ||
|
||
performance.measure('rerender1k-big-template', '1k-start', '1k-end'); | ||
</script> |
Empty file.
Oops, something went wrong.