Skip to content

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

Closed
matsko wants to merge 1 commit into
angular:masterfrom
matsko:duplciate_map_based_style_and_bindings_benchmark
Closed

matsko wants to merge 1 commit into
angular:masterfrom
matsko:duplciate_map_based_style_and_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 map-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 map-based styling bindings.

This benchmark introduces benchmarking for map-based style/class bindings
that are evaluated from both template bindings as well as directives.

This benchmark can be executed by calling:

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

node dist/bin/packages/core/test/render3/perf/duplicate_map_based_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 22:59
@ngbot ngbot Bot modified the milestone: needsTriage Nov 5, 2019

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.

i don't see why we need to have this function. Can we just call the one in the render3 folder?

@matsko

matsko commented Nov 6, 2019

Copy link
Copy Markdown
Contributor Author
┌──────────────────────────────────────────────┬─────────┬──────┬───────────┬───────────┬───┐
│                   (index)                    │  time   │ unit │ base_time │ base_unit │ % │
├──────────────────────────────────────────────┼─────────┼──────┼───────────┼───────────┼───┤
│                class_binding                 │ 170.362 │ 'ns' │           │           │   │
│            directive_instantiate             │  1.742  │ 'us' │           │           │   │
│ duplicate_map_based_style_and_class_bindings │ 14.666  │ 'ms' │           │           │   │
│      duplicate_style_and_class_bindings      │  7.884  │ 'ms' │           │           │   │
│             element_text_create              │ 989.532 │ 'ns' │           │           │   │
│                interpolation                 │  157.3  │ 'us' │           │           │   │
│                  listeners                   │  1.48   │ 'us' │           │           │   │
│      map_based_style_and_class_bindings      │ 14.396  │ 'ms' │           │           │   │
│                 ng_template                  │ 481.983 │ 'ns' │           │           │   │
│            noop_change_detection             │ 19.515  │ 'us' │           │           │   │
│               property_binding               │ 170.588 │ 'us' │           │           │   │
│           property_binding_update            │ 324.69  │ 'us' │           │           │   │
│           style_and_class_bindings           │ 903.191 │ 'us' │           │           │   │
│                style_binding                 │ 383.216 │ 'us' │           │           │   │
└──────────────────────────────────────────────┴─────────┴──────┴───────────┴───────────┴───┘

@matsko
matsko force-pushed the duplciate_map_based_style_and_bindings_benchmark branch 5 times, most recently from faae227 to 7e2f407 Compare November 6, 2019 21:08

@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 force-pushed the duplciate_map_based_style_and_bindings_benchmark branch from 7e2f407 to 2d732a9 Compare November 7, 2019 16:01
@matsko matsko added action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Nov 7, 2019
…bindings

Prior to this patch all the styling benchmarks only tested for
template map-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 map-based styling bindings.

This benchmark introduces benchmarking for map-based style/class bindings
that are evaluated from both template bindings as well as directives.

This benchmark can be executed by calling:

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

node dist/bin/packages/core/test/render3/perf/duplicate_map_based_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 duplciate_map_based_style_and_bindings_benchmark branch from 2d732a9 to 894f7cc Compare November 7, 2019 18:03
@matsko matsko added the action: merge The PR is ready for merge by the caretaker label Nov 7, 2019
@atscott atscott closed this in 71b400e Nov 7, 2019
atscott pushed a commit that referenced this pull request Nov 7, 2019
…bindings (#33608)

Prior to this patch all the styling benchmarks only tested for
template map-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 map-based styling bindings.

This benchmark introduces benchmarking for map-based style/class bindings
that are evaluated from both template bindings as well as directives.

This benchmark can be executed by calling:

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

node dist/bin/packages/core/test/render3/perf/duplicate_map_based_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 #33608
@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