From 65dbd505942151d4d47d95ee9bb65f2bf6c4bed4 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 31 Jan 2020 15:30:57 -0800 Subject: [PATCH] test(ivy): correct var count in perf benchmarks. (#35071) These tests are used for perf testing and don't run as part of CI, as a result they bit-rotted. This fixes that. Long term these tests should be run as part of CI. PR Close #35071 --- packages/core/test/render3/perf/README.md | 4 ++++ packages/core/test/render3/perf/class_binding/index.ts | 4 ++-- .../duplicate_map_based_style_and_class_bindings/index.ts | 2 +- .../render3/perf/map_based_style_and_class_bindings/index.ts | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/core/test/render3/perf/README.md b/packages/core/test/render3/perf/README.md index 6fe43f71e0..561711022a 100644 --- a/packages/core/test/render3/perf/README.md +++ b/packages/core/test/render3/perf/README.md @@ -78,3 +78,7 @@ To profile, append `_profile` to the target name and attach a debugger via chrom - `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection_profile` To interactively edit/rerun benchmarks use `ibazel` instead of `bazel`. + +To debug +- `yarn bazel build --config=ivy //packages/core/test/render3/perf:noop_change_detection` +- `node --inspect-brk bazel-out/darwin-fastbuild/bin/packages/core/test/render3/perf/noop_change_detection.min_debug.es2015.js` \ No newline at end of file diff --git a/packages/core/test/render3/perf/class_binding/index.ts b/packages/core/test/render3/perf/class_binding/index.ts index af0ff662ed..3085bd3ee4 100644 --- a/packages/core/test/render3/perf/class_binding/index.ts +++ b/packages/core/test/render3/perf/class_binding/index.ts @@ -26,8 +26,8 @@ const benchmarks: Benchmark[] = []; function benchmark( name: string, template: ComponentTemplate, baselineTemplate: ComponentTemplate) { - const ivyHarness = setupTestHarness(template, 1, 1, 1000, context, consts); - const baseHarness = setupTestHarness(baselineTemplate, 1, 1, 1000, context, consts); + const ivyHarness = setupTestHarness(template, 1, 4, 1000, context, consts); + const baseHarness = setupTestHarness(baselineTemplate, 1, 4, 1000, context, consts); if (PROFILE_CREATE) { const benchmark = createBenchmark('class binding[create]: ' + name); diff --git a/packages/core/test/render3/perf/duplicate_map_based_style_and_class_bindings/index.ts b/packages/core/test/render3/perf/duplicate_map_based_style_and_class_bindings/index.ts index db41dfae9f..efc2a60d58 100644 --- a/packages/core/test/render3/perf/duplicate_map_based_style_and_class_bindings/index.ts +++ b/packages/core/test/render3/perf/duplicate_map_based_style_and_class_bindings/index.ts @@ -149,7 +149,7 @@ function dirThatSetsFooClassesHostBindings(rf: RenderFlags, ctx: any) { } const rootLView = setupRootViewWithEmbeddedViews( - testTemplate, 11, 10, 1000, null, + testTemplate, 11, 40, 1000, null, [ ['dir-that-sets-width', '', 'dir-that-sets-foo-class', ''], ], diff --git a/packages/core/test/render3/perf/map_based_style_and_class_bindings/index.ts b/packages/core/test/render3/perf/map_based_style_and_class_bindings/index.ts index f8f74bb2f8..5ef13e8f14 100644 --- a/packages/core/test/render3/perf/map_based_style_and_class_bindings/index.ts +++ b/packages/core/test/render3/perf/map_based_style_and_class_bindings/index.ts @@ -78,7 +78,7 @@ function testTemplate(rf: RenderFlags, ctx: any) { } -const rootLView = setupRootViewWithEmbeddedViews(testTemplate, 11, 10, 1000); +const rootLView = setupRootViewWithEmbeddedViews(testTemplate, 11, 40, 1000); const rootTView = rootLView[TVIEW]; // scenario to benchmark