Skip to content
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

perf(ivy): replace select instruction with advance #32516

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/benchmarks/src/tree/render3_function/index.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {ɵRenderFlags, ɵrenderComponent as renderComponent, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵselect, ɵɵstyleProp, ɵɵstyling, ɵɵstylingApply, ɵɵtext, ɵɵtextInterpolate1} from '@angular/core';
import {ɵRenderFlags, ɵrenderComponent as renderComponent, ɵɵadvance, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵstyleProp, ɵɵstyling, ɵɵstylingApply, ɵɵtext, ɵɵtextInterpolate1} from '@angular/core';

import {bindAction, profile} from '../../util';
import {createDom, destroyDom, detectChanges} from '../render3/tree';
Expand Down Expand Up @@ -48,10 +48,10 @@ export function TreeTpl(rf: ɵRenderFlags, ctx: TreeNode) {
ɵɵelementEnd();
}
if (rf & ɵRenderFlags.Update) {
ɵɵselect(1);
ɵɵadvance(1);
ɵɵstyleProp('background-color', ctx.depth % 2 ? '' : 'grey');
ɵɵstylingApply();
ɵɵselect(2);
ɵɵadvance(1);
ɵɵtextInterpolate1(' ', ctx.value, ' ');
ɵɵcontainerRefreshStart(3);
{
Expand Down
Expand Up @@ -774,7 +774,7 @@ describe('compiler compliance', () => {
if (rf & 2) {
const $myComp$ = $r3$.ɵɵnextContext();
const $foo$ = $r3$.ɵɵreference(1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵtextInterpolate2("", $myComp$.salutation, " ", $foo$, "");
}
}
Expand Down Expand Up @@ -1275,7 +1275,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
$r3$.ɵɵproperty("ngIf", ctx.visible);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("ngIf", ctx.visible);
}
}
Expand Down Expand Up @@ -2032,7 +2032,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
$r3$.ɵɵtextInterpolate($r3$.ɵɵpipeBind2(1, 3, $r3$.ɵɵpipeBind2(2, 6, ctx.name, ctx.size), ctx.size));
$r3$.ɵɵselect(4);
$r3$.ɵɵadvance(4);
$r3$.ɵɵtextInterpolate2("", $r3$.ɵɵpipeBindV(5, 9, $r3$.ɵɵpureFunction1(18, $c0$, ctx.name)), " ", ctx.name ? 1 : $r3$.ɵɵpipeBind1(6, 16, 2), "");
}
},
Expand Down Expand Up @@ -2216,7 +2216,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
const $user$ = $r3$.ɵɵreference(1);
$r3$.ɵɵselect(2);
$r3$.ɵɵadvance(2);
$r3$.ɵɵtextInterpolate1("Hello ", $user$.value, "!");
}
},
Expand Down Expand Up @@ -2279,7 +2279,7 @@ describe('compiler compliance', () => {
$r3$.ɵɵnextContext();
const $foo$ = $r3$.ɵɵreference(1);
const $baz$ = $r3$.ɵɵreference(5);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵtextInterpolate3("", $foo$, "-", $bar$, "-", $baz$, "");
}
}
Expand All @@ -2295,7 +2295,7 @@ describe('compiler compliance', () => {
const $bar$ = $r3$.ɵɵreference(4);
$r3$.ɵɵnextContext();
const $foo$ = $r3$.ɵɵreference(1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵtextInterpolate2(" ", $foo$, "-", $bar$, " ");
}
}
Expand All @@ -2314,7 +2314,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
const $foo$ = $r3$.ɵɵreference(1);
$r3$.ɵɵselect(2);
$r3$.ɵɵadvance(2);
$r3$.ɵɵtextInterpolate1(" ", $foo$, " ");
}
},
Expand Down Expand Up @@ -2365,7 +2365,7 @@ describe('compiler compliance', () => {
if (rf & 2) {
const $item$ = $i0$.ɵɵnextContext().$implicit;
const $foo$ = $i0$.ɵɵreference(2);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$i0$.ɵɵtextInterpolate2(" ", $foo$, " - ", $item$, " ");
}
}
Expand All @@ -2379,7 +2379,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
const $app$ = $i0$.ɵɵnextContext();
$r3$.ɵɵselect(3);
$r3$.ɵɵadvance(3);
$i0$.ɵɵproperty("ngIf", $app$.showing);
}
}
Expand Down Expand Up @@ -2469,7 +2469,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
$r3$.ɵɵproperty("name", ctx.name1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("name", ctx.name2);
}
},
Expand Down Expand Up @@ -2602,7 +2602,7 @@ describe('compiler compliance', () => {
$r3$.ɵɵelementEnd();
}
if (rf & 2) {
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("forOf", ctx.items);
}
},
Expand Down Expand Up @@ -2670,7 +2670,7 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
const $item$ = ctx.$implicit;
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵtextInterpolate($item$.name);
}
}
Expand All @@ -2687,7 +2687,7 @@ describe('compiler compliance', () => {
$r3$.ɵɵelementEnd();
}
if (rf & 2) {
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("forOf", ctx.items);
}
},
Expand Down Expand Up @@ -2753,7 +2753,7 @@ describe('compiler compliance', () => {
if (rf & 2) {
const $info$ = ctx.$implicit;
const $item$ = $r3$.ɵɵnextContext().$implicit;
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵtextInterpolate2(" ", $item$.name, ": ", $info$.description, " ");
}
}
Expand All @@ -2771,9 +2771,9 @@ describe('compiler compliance', () => {
}
if (rf & 2) {
const $item$ = ctx.$implicit;
$r3$.ɵɵselect(2);
$r3$.ɵɵadvance(2);
$r3$.ɵɵtextInterpolate(IDENT.name);
$r3$.ɵɵselect(4);
$r3$.ɵɵadvance(2);
$r3$.ɵɵproperty("forOf", IDENT.infos);
}
}
Expand All @@ -2791,7 +2791,7 @@ describe('compiler compliance', () => {
$r3$.ɵɵelementEnd();
}
if (rf & 2) {
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("forOf", ctx.items);
}
},
Expand Down
Expand Up @@ -44,7 +44,7 @@ describe('compiler compliance: bindings', () => {
$i0$.ɵɵelementEnd();
}
if (rf & 2) {
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$i0$.ɵɵtextInterpolate1("Hello ", $ctx$.name, "");
}
}`;
Expand Down Expand Up @@ -360,9 +360,9 @@ describe('compiler compliance: bindings', () => {
if (rf & 2) {
$r3$.ɵɵproperty("title", ctx.myTitle)("id", ctx.buttonId)("tabindex", 1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("id", 1)("title", "hello")("someProp", 1 + 2);
$r3$.ɵɵselect(2);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("prop", "one")("otherProp", 2);
}
}
Expand Down Expand Up @@ -397,7 +397,7 @@ describe('compiler compliance: bindings', () => {
if (rf & 2) {
$r3$.ɵɵproperty("title", ctx.myTitle)("id", ctx.buttonId)("tabindex", 1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵproperty("id", 1)("title", "hello")("someProp", 1 + 2);
}
}
Expand Down Expand Up @@ -566,9 +566,9 @@ describe('compiler compliance: bindings', () => {
if (rf & 2) {
$r3$.ɵɵattribute("title", ctx.myTitle)("id", ctx.buttonId)("tabindex", 1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵattribute("id", 1)("title", "hello")("some-attr", 1 + 2);
$r3$.ɵɵselect(2);
$r3$.ɵɵadvance(1);
$r3$.ɵɵattribute("some-attr", "one")("some-other-attr", 2);
}
}
Expand Down Expand Up @@ -603,7 +603,7 @@ describe('compiler compliance: bindings', () => {
if (rf & 2) {
$r3$.ɵɵattribute("title", ctx.myTitle)("id", ctx.buttonId)("tabindex", 1);
$r3$.ɵɵselect(1);
$r3$.ɵɵadvance(1);
$r3$.ɵɵattribute("id", 1)("title", "hello")("some-attr", 1 + 2);
}
}
Expand Down Expand Up @@ -1173,23 +1173,23 @@ describe('compiler compliance: bindings', () => {
if (rf & 2) {
i0.ɵɵpropertyInterpolateV("title", ["a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i", ctx.nine, "j"]);
i0.ɵɵselect(1);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate8("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i");
i0.ɵɵselect(2);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate7("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h");
i0.ɵɵselect(3);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate6("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g");
i0.ɵɵselect(4);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate5("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f");
i0.ɵɵselect(5);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate4("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e");
i0.ɵɵselect(6);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate3("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d");
i0.ɵɵselect(7);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate2("title", "a", ctx.one, "b", ctx.two, "c");
i0.ɵɵselect(8);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate1("title", "a", ctx.one, "b");
i0.ɵɵselect(9);
i0.ɵɵadvance(1);
i0.ɵɵpropertyInterpolate("title", ctx.one);
}
Expand Down Expand Up @@ -1217,23 +1217,23 @@ describe('compiler compliance: bindings', () => {
if (rf & 2) {
i0.ɵɵattributeInterpolateV("title", ["a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i", ctx.nine, "j"]);
i0.ɵɵselect(1);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate8("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i");
i0.ɵɵselect(2);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate7("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h");
i0.ɵɵselect(3);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate6("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g");
i0.ɵɵselect(4);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate5("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f");
i0.ɵɵselect(5);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate4("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e");
i0.ɵɵselect(6);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate3("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d");
i0.ɵɵselect(7);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate2("title", "a", ctx.one, "b", ctx.two, "c");
i0.ɵɵselect(8);
i0.ɵɵadvance(1);
i0.ɵɵattributeInterpolate1("title", "a", ctx.one, "b");
i0.ɵɵselect(9);
i0.ɵɵadvance(1);
i0.ɵɵattribute("title", ctx.one);
}
Expand Down Expand Up @@ -1267,7 +1267,7 @@ describe('compiler compliance: bindings', () => {
}
if (rf & 2) {
const $_r0$ = $i0$.ɵɵreference(1);
$r3$.ɵɵselect(4);
$r3$.ɵɵadvance(4);
$i0$.ɵɵtextInterpolate1(" ", $_r0$.id, " ");
}
}
Expand Down