Skip to content
Closed

Ivy #20855

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b8c2cbe
feat(core): Moving Renderer3 into @angular/core
mhevery Dec 1, 2017
e959440
refactor(core): store locals in main array in rederer3
mhevery Dec 8, 2017
8924445
perf: add large table and deep tree benchmarks for render3
marclaval Dec 11, 2017
e6b1ec7
perf: add benchmarks for IV and render3 with functions (tree)
marclaval Dec 12, 2017
f5af17c
docs(core): add comments to assert functions
kara Dec 13, 2017
d9826e5
docs(core): add comments to node_manipulation functions
kara Dec 13, 2017
b6c3101
refactor(core): store directive defs in static data
kara Dec 11, 2017
026748b
docs(core): document di and minor renames
kara Dec 13, 2017
4cf0d84
docs(core): add more comments to di and fix formatting
kara Dec 14, 2017
70c10c4
refactor(core): renamed and split out interfaces
kara Dec 14, 2017
cf65350
style: fix formatting errors
mhevery Dec 14, 2017
c7142c8
docs(core): add docs to instructions, minor renames
kara Dec 14, 2017
69db520
refactor(core): rename instructions for consistency
kara Dec 15, 2017
28cbf2f
perf: use style.setProperty instead of setAttribute in render3 and iv…
marclaval Dec 13, 2017
bc69f35
style: fix formatting errors
mhevery Dec 14, 2017
53e6363
feat: support queries for elements with local names
pkozlowski-opensource Dec 12, 2017
7618565
feat(core): add renderer factory in render3
marclaval Dec 11, 2017
48ad6e2
refactor: remove import circular dependencies
pkozlowski-opensource Dec 15, 2017
8be04bb
test(core): animation renderer factory in render3
marclaval Dec 15, 2017
c1d1f83
docs(core): add missing docs to component and fix formatting
kara Dec 15, 2017
0951ded
feat(core): support 'read' option for ngIvy queries
pkozlowski-opensource Dec 18, 2017
63a993f
build: yarn buildifier
mhevery Dec 19, 2017
58def09
build: fix benchmarks for render3
mhevery Dec 19, 2017
0ad6b71
build: fix circular dep between interface and l_node by merging
mhevery Dec 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions karma-js.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = function(config) {
'dist/all/@angular/**/*node_only_spec.js',
'dist/all/@angular/benchpress/**',
'dist/all/@angular/compiler-cli/**',
'dist/all/@angular/core/test/render3/**',
'dist/all/@angular/compiler/test/aot/**',
'dist/all/@angular/examples/**/e2e_test/*',
'dist/all/@angular/language-service/**',
Expand Down
18 changes: 18 additions & 0 deletions modules/benchmarks/e2e_test/largetable_perf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ describe('largetable benchmark perf', () => {
}).then(done, done.fail);
});

it('should run for render3', (done) => {
runTableBenchmark({
id: `largeTable.render3.${worker.id}`,
url: 'all/benchmarks/src/largetable/render3/index.html',
ignoreBrowserSynchronization: true,
worker: worker
}).then(done, done.fail);
});

it('should run for iv', (done) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ivy

runTableBenchmark({
id: `largeTable.iv.${worker.id}`,
url: 'all/benchmarks/src/largetable/iv/index.html',
ignoreBrowserSynchronization: true,
worker: worker
}).then(done, done.fail);
});

it('should run for the baseline', (done) => {
runTableBenchmark({
id: `largeTable.baseline.${worker.id}`,
Expand Down
14 changes: 14 additions & 0 deletions modules/benchmarks/e2e_test/largetable_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ describe('largetable benchmark spec', () => {
});
});

it('should work for render3', () => {
testTableBenchmark({
url: 'all/benchmarks/src/largetable/render3/index.html',
ignoreBrowserSynchronization: true,
});
});

it('should work for iv', () => {
testTableBenchmark({
url: 'all/benchmarks/src/largetable/iv/index.html',
ignoreBrowserSynchronization: true,
});
});

it('should work for the baseline', () => {
testTableBenchmark({
url: 'all/benchmarks/src/largetable/baseline/index.html',
Expand Down
18 changes: 18 additions & 0 deletions modules/benchmarks/e2e_test/tree_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ivy

url: 'all/benchmarks/src/tree/iv/index.html',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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',
Expand Down
31 changes: 31 additions & 0 deletions modules/benchmarks/src/largetable/iv/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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>
9 changes: 9 additions & 0 deletions modules/benchmarks/src/largetable/iv/largetable.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions modules/benchmarks/src/largetable/render3/index.html
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>
28 changes: 28 additions & 0 deletions modules/benchmarks/src/largetable/render3/index.ts
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'));
}
}
81 changes: 81 additions & 0 deletions modules/benchmarks/src/largetable/render3/table.ts
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);
}
30 changes: 30 additions & 0 deletions modules/benchmarks/src/tree/iv/index.html
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>
Loading