Skip to content

test(ivy): introduce a benchmark for duplicate style/class bindings - #33600

Closed
matsko wants to merge 2 commits into
angular:masterfrom
matsko:duplicate_style_and_class_bindings_benchmark
Closed

matsko wants to merge 2 commits into
angular:masterfrom
matsko:duplicate_style_and_class_bindings_benchmark

Conversation

@matsko

@matsko matsko commented Nov 5, 2019

Copy link
Copy Markdown
Contributor

Prior to this patch all the styling benchmarks only tested for
template-based style/class bindings. Because of each of the bindings
being only present in the template, there was no possibility of
there being any duplicate bindings. This benchmark introduces
style/class bindings being evaluated from both a template and from
various directives.

This benchmark can be executed by calling:

bazel build //packages/core/test/render3/perf:duplicate_style_and_class_bindings_lib.min_debug.es2015.js

node dist/bin/packages/core/test/render3/perf/duplicate_style_and_class_bindings_lib.min_debug.es2015.js

The benchmark is also run via the profile_all.js script (found in
packages/core/test/render3/perf/)

@matsko matsko added target: patch This PR is targeted for the next patch release comp: ivy labels Nov 5, 2019
@matsko
matsko requested review from a team, mhevery and pkozlowski-opensource November 5, 2019 20:23
@ngbot ngbot Bot modified the milestone: needsTriage Nov 5, 2019
@matsko
matsko force-pushed the duplicate_style_and_class_bindings_benchmark branch from 06ee426 to 132257e Compare November 5, 2019 20:38
@matsko

matsko commented Nov 5, 2019

Copy link
Copy Markdown
Contributor Author
┌────────────────────────────────────┬─────────┬──────┬───────────┬───────────┬───┐
│              (index)               │  time   │ unit │ base_time │ base_unit │ % │
├────────────────────────────────────┼─────────┼──────┼───────────┼───────────┼───┤
│           class_binding            │ 167.192 │ 'ns' │           │           │   │
│       directive_instantiate        │  1.744  │ 'us' │           │           │   │
│ duplicate_style_and_class_bindings │  7.854  │ 'ms' │           │           │   │
│        element_text_create         │ 987.821 │ 'ns' │           │           │   │
│           interpolation            │ 151.613 │ 'us' │           │           │   │
│             listeners              │  1.474  │ 'us' │           │           │   │
│ map_based_style_and_class_bindings │ 14.366  │ 'ms' │           │           │   │
│            ng_template             │ 486.683 │ 'ns' │           │           │   │
│       noop_change_detection        │ 19.508  │ 'us' │           │           │   │
│          property_binding          │ 167.807 │ 'us' │           │           │   │
│      property_binding_update       │ 333.315 │ 'us' │           │           │   │
│      style_and_class_bindings      │ 914.12  │ 'us' │           │           │   │
│           style_binding            │ 351.994 │ 'us' │           │           │   │
└────────────────────────────────────┴─────────┴──────┴───────────┴───────────┴───┘

@matsko
matsko force-pushed the duplicate_style_and_class_bindings_benchmark branch 6 times, most recently from f6d3dae to 4abeb5a Compare November 5, 2019 23:09
@matsko
matsko force-pushed the duplicate_style_and_class_bindings_benchmark branch 5 times, most recently from 2e8ae7e to a85d130 Compare November 6, 2019 20:05

@pkozlowski-opensource pkozlowski-opensource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM generally speaking. I'm just slightly worried about the fact that we start to have multiple ways of defining test directives, ex. compare your approach with the already existing one: https://github.com/angular/angular/blob/master/packages/core/test/render3/perf/directive_instantiate/index.ts

Could you think of mutualising those directive creation utils (not now, but something to keep in mind).

@matsko matsko added the action: merge The PR is ready for merge by the caretaker label Nov 7, 2019
@ngbot

ngbot Bot commented Nov 7, 2019

Copy link
Copy Markdown

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure conflicts with base branch "master"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

Prior to this patch all the styling benchmarks only tested for
template-based style/class bindings. Because of each of the bindings
being only present in the template, there was no possibility of
there being any duplicate bindings. This benchmark introduces
style/class bindings being evaluated from both a template and from
various directives.

This benchmark can be executed by calling:

```
bazel build //packages/core/test/render3/perf:duplicate_style_and_class_bindings_lib.min_debug.es2015.js

node dist/bin/packages/core/test/render3/perf/duplicate_style_and_class_bindings_lib.min_debug.es2015.js
```

The benchmark is also run via the `profile_all.js` script (found in
`packages/core/test/render3/perf/`)
@matsko
matsko force-pushed the duplicate_style_and_class_bindings_benchmark branch from a85d130 to 0a0e82b Compare November 7, 2019 16:00
@atscott atscott closed this in 8d72a37 Nov 7, 2019
atscott pushed a commit that referenced this pull request Nov 7, 2019
…33600)

Prior to this patch all the styling benchmarks only tested for
template-based style/class bindings. Because of each of the bindings
being only present in the template, there was no possibility of
there being any duplicate bindings. This benchmark introduces
style/class bindings being evaluated from both a template and from
various directives.

This benchmark can be executed by calling:

```
bazel build //packages/core/test/render3/perf:duplicate_style_and_class_bindings_lib.min_debug.es2015.js

node dist/bin/packages/core/test/render3/perf/duplicate_style_and_class_bindings_lib.min_debug.es2015.js
```

The benchmark is also run via the `profile_all.js` script (found in
`packages/core/test/render3/perf/`)

PR Close #33600
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Dec 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants