-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Ivy #20855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ivy #20855
Changes from all commits
b8c2cbe
e959440
8924445
e6b1ec7
f5af17c
d9826e5
b6c3101
026748b
4cf0d84
70c10c4
cf65350
c7142c8
69db520
28cbf2f
bc69f35
53e6363
7618565
48ad6e2
8be04bb
c1d1f83
0951ded
63a993f
58def09
0ad6b71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,24 @@ export const Benchmarks: Benchmark[] = [ | |
| url: 'all/benchmarks/src/tree/ng2_switch/index.html', | ||
| buttons: CreateDestroyButtons, | ||
| }, | ||
| { | ||
| id: `deepTree.ng2.render3`, | ||
| url: 'all/benchmarks/src/tree/render3/index.html', | ||
| buttons: CreateDestroyDetectChangesButtons, | ||
| ignoreBrowserSynchronization: true, | ||
| }, | ||
| { | ||
| id: `deepTree.ng2.render3_function`, | ||
| url: 'all/benchmarks/src/tree/render3_function/index.html', | ||
| buttons: CreateDestroyDetectChangesButtons, | ||
| ignoreBrowserSynchronization: true, | ||
| }, | ||
| { | ||
| id: `deepTree.iv`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ivy |
||
| url: 'all/benchmarks/src/tree/iv/index.html', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename the dir to ivy |
||
| buttons: CreateDestroyDetectChangesButtons, | ||
| ignoreBrowserSynchronization: true, | ||
| }, | ||
| { | ||
| id: `deepTree.baseline`, | ||
| url: 'all/benchmarks/src/tree/baseline/index.html', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <!doctype html> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename directory to ivy |
||
| <html> | ||
| <body> | ||
|
|
||
| <h2>Params</h2> | ||
| <form> | ||
| Cols: | ||
| <input type="number" name="cols" placeholder="cols" value="40"> | ||
| <br> | ||
| Rows: | ||
| <input type="number" name="rows" placeholder="rows" value="200"> | ||
| <br> | ||
| <button>Apply</button> | ||
| </form> | ||
|
|
||
| <h2>IV Largetable Benchmark</h2> | ||
| <p> | ||
| <button id="destroyDom">destroyDom</button> | ||
| <button id="createDom">createDom</button> | ||
| <button id="updateDomProfile">profile updateDom</button> | ||
| <button id="createDomProfile">profile createDom</button> | ||
| </p> | ||
|
|
||
| <div> | ||
| <largetable id="root"></largetable> | ||
| </div> | ||
|
|
||
| <script type="text/javascript" src="largetable.js"></script> | ||
|
|
||
| </body> | ||
| </html> | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <body> | ||
|
|
||
| <h2>Params</h2> | ||
| <form> | ||
| Cols: | ||
| <input type="number" name="cols" placeholder="cols" value="40"> | ||
| <br> | ||
| Rows: | ||
| <input type="number" name="rows" placeholder="rows" value="200"> | ||
| <br> | ||
| <button>Apply</button> | ||
| </form> | ||
|
|
||
| <h2>Render3 Largetable Benchmark</h2> | ||
| <p> | ||
| <button id="destroyDom">destroyDom</button> | ||
| <button id="createDom">createDom</button> | ||
| <button id="updateDomProfile">profile updateDom</button> | ||
| <button id="createDomProfile">profile createDom</button> | ||
| </p> | ||
|
|
||
| <div> | ||
| <largetable id="root"></largetable> | ||
| </div> | ||
|
|
||
| <script> | ||
| var mainUrl = window.location.search.split(/[?&]main=([^&]+)/)[1] | ||
| || '../../bootstrap_ng2.js'; | ||
| document.write('<script src="' + mainUrl + '">\u003c/script>'); | ||
| </script> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| */ | ||
|
|
||
| import {ɵrenderComponent as renderComponent} from '@angular/core'; | ||
|
|
||
| import {bindAction, profile} from '../../util'; | ||
|
|
||
| import {LargeTableComponent, createDom, destroyDom} from './table'; | ||
|
|
||
| function noop() {} | ||
|
|
||
| export function main() { | ||
| let component: LargeTableComponent; | ||
| if (typeof window !== 'undefined') { | ||
| component = renderComponent<LargeTableComponent>(LargeTableComponent); | ||
| bindAction('#createDom', () => createDom(component)); | ||
| bindAction('#destroyDom', () => destroyDom(component)); | ||
| bindAction('#updateDomProfile', profile(() => createDom(component), noop, 'update')); | ||
| bindAction( | ||
| '#createDomProfile', | ||
| profile(() => createDom(component), () => destroyDom(component), 'create')); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| */ | ||
|
|
||
| import {ɵC as C, ɵE as E, ɵT as T, ɵV as V, ɵb as b, ɵc as c, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as detectChanges, ɵe as e, ɵs as s, ɵt as t, ɵv as v} from '@angular/core'; | ||
| import {ComponentDef} from '@angular/core/src/render3/definition_interfaces'; | ||
|
|
||
| import {TableCell, buildTable, emptyTable} from '../util'; | ||
|
|
||
| export class LargeTableComponent { | ||
| data: TableCell[][] = emptyTable; | ||
|
|
||
| /** @nocollapse */ | ||
| static ngComponentDef: ComponentDef<LargeTableComponent> = defineComponent({ | ||
| type: LargeTableComponent, | ||
| tag: 'largetable', | ||
| template: function(ctx: LargeTableComponent, cm: boolean) { | ||
| if (cm) { | ||
| E(0, 'table'); | ||
| { | ||
| E(1, 'tbody'); | ||
| { | ||
| C(2); | ||
| c(); | ||
| } | ||
| e(); | ||
| } | ||
| e(); | ||
| } | ||
| cR(2); | ||
| { | ||
| for (let row of ctx.data) { | ||
| let cm1 = V(1); | ||
| { | ||
| if (cm1) { | ||
| E(0, 'tr'); | ||
| C(1); | ||
| c(); | ||
| e(); | ||
| } | ||
| cR(1); | ||
| { | ||
| for (let cell of row) { | ||
| let cm2 = V(2); | ||
| { | ||
| if (cm2) { | ||
| E(0, 'td'); | ||
| { T(1); } | ||
| e(); | ||
| } | ||
| s(0, 'background-color', b(cell.row % 2 ? '' : 'grey')); | ||
| t(1, b(cell.value)); | ||
| } | ||
| v(); | ||
| } | ||
| } | ||
| cr(); | ||
| } | ||
| v(); | ||
| } | ||
| } | ||
| cr(); | ||
| }, | ||
| factory: () => new LargeTableComponent(), | ||
| inputs: {data: 'data'} | ||
| }); | ||
| } | ||
|
|
||
| export function destroyDom(component: LargeTableComponent) { | ||
| component.data = emptyTable; | ||
| detectChanges(component); | ||
| } | ||
|
|
||
| export function createDom(component: LargeTableComponent) { | ||
| component.data = buildTable(); | ||
| detectChanges(component); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <body> | ||
|
|
||
| <h2>Params</h2> | ||
| <form> | ||
| Depth: | ||
| <input type="number" name="depth" placeholder="depth" value="9"> | ||
| <br> | ||
| <button>Apply</button> | ||
| </form> | ||
|
|
||
| <h2>IV Tree Benchmark</h2> | ||
| <p> | ||
| <button id="destroyDom">destroyDom</button> | ||
| <button id="createDom">createDom</button> | ||
| <button id="detectChanges">detectChanges</button> | ||
| <button id="updateDomProfile">profile updateDom</button> | ||
| <button id="createDomProfile">profile createDom</button> | ||
| <button id="detectChangesProfile">profile detectChanges</button> | ||
| </p> | ||
|
|
||
| <div> | ||
| Change detection runs:<span id="numberOfChecks"></span> | ||
| </div> | ||
| <div id="root"></div> | ||
|
|
||
| <script type="text/javascript" src="tree.js"></script> | ||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ivy