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

fix(engine): marking dynamic nodes as dynamic #810

Merged
merged 5 commits into from
Nov 8, 2018

Conversation

davidturissini
Copy link
Contributor

Details

Fixes a text rendering issue in baseCombobobxFormattedText. Switching between an iterator and a plain text node was causing duplicate text to render.

Does this PR introduce a breaking change?

  • Yes
  • No

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: a5b99f1 | Target commit: c35af6e

lwc-engine-benchmark

table-append-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table/append/1k duration 158.05 (±4.25 ms) 159.50 (±3.85 ms) +1.4ms (0.9%) 👌
table-clear-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table/clear/1k duration 6.40 (±0.45 ms) 7.10 (±0.55 ms) +0.7ms (10.9%) 👎
table-create-10k metric base(a5b99f1) target(c35af6e) trend
benchmark-table/create/10k duration 922.15 (±8.70 ms) 931.70 (±8.30 ms) +9.5ms (1.0%) 👎
table-create-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table/create/1k duration 122.05 (±3.15 ms) 121.75 (±2.75 ms) -0.3ms (0.2%) 👌
table-update-10th-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table/update-10th/1k duration 79.00 (±2.65 ms) 80.20 (±2.90 ms) +1.2ms (1.5%) 👌
tablecmp-append-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-component/append/1k duration 260.75 (±7.05 ms) 266.75 (±6.20 ms) +6.0ms (2.3%) 👎
tablecmp-clear-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-component/clear/1k duration 12.20 (±1.75 ms) 13.10 (±1.70 ms) +0.9ms (7.4%) 👌
tablecmp-create-10k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-component/create/10k duration 1811.95 (±15.75 ms) 1831.65 (±14.60 ms) +19.7ms (1.1%) 👎
tablecmp-create-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-component/create/1k duration 211.35 (±5.40 ms) 218.05 (±4.60 ms) +6.7ms (3.2%) 👎
tablecmp-update-10th-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-component/update-10th/1k duration 72.50 (±4.15 ms) 74.25 (±3.65 ms) +1.8ms (2.4%) 👌
wc-append-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-wc/append/1k duration 297.60 (±10.20 ms) 316.35 (±7.70 ms) +18.8ms (6.3%) 👎
wc-clear-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-wc/clear/1k duration 23.95 (±2.45 ms) 26.00 (±2.15 ms) +2.1ms (8.6%) 👌
wc-create-10k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-wc/create/10k duration 4463.70 (±27.80 ms) 4554.20 (±22.20 ms) +90.5ms (2.0%) 👎
wc-create-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-wc/create/1k duration 267.25 (±5.30 ms) 272.25 (±6.95 ms) +5.0ms (1.9%) 👎
wc-update-10th-1k metric base(a5b99f1) target(c35af6e) trend
benchmark-table-wc/update-10th/1k duration 77.00 (±6.15 ms) 81.95 (±6.15 ms) +5.0ms (6.4%) 👎

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: a5b99f1 | Target commit: d195bb8

lwc-engine-benchmark

table-append-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table/append/1k duration 158.05 (±4.25 ms) 158.90 (±4.25 ms) +0.8ms (0.5%) 👌
table-clear-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table/clear/1k duration 6.40 (±0.45 ms) 6.70 (±0.30 ms) +0.3ms (4.7%) 👎
table-create-10k metric base(a5b99f1) target(d195bb8) trend
benchmark-table/create/10k duration 922.15 (±8.70 ms) 943.65 (±5.90 ms) +21.5ms (2.3%) 👎
table-create-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table/create/1k duration 122.05 (±3.15 ms) 121.30 (±1.75 ms) -0.8ms (0.6%) 👌
table-update-10th-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table/update-10th/1k duration 79.00 (±2.65 ms) 82.00 (±3.80 ms) +3.0ms (3.8%) 👎
tablecmp-append-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-component/append/1k duration 260.75 (±7.05 ms) 269.80 (±7.25 ms) +9.0ms (3.5%) 👎
tablecmp-clear-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-component/clear/1k duration 12.20 (±1.75 ms) 12.90 (±1.40 ms) +0.7ms (5.7%) 👌
tablecmp-create-10k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-component/create/10k duration 1811.95 (±15.75 ms) 1833.10 (±13.80 ms) +21.2ms (1.2%) 👎
tablecmp-create-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-component/create/1k duration 211.35 (±5.40 ms) 221.95 (±5.30 ms) +10.6ms (5.0%) 👎
tablecmp-update-10th-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-component/update-10th/1k duration 72.50 (±4.15 ms) 74.75 (±5.60 ms) +2.3ms (3.1%) 👌
wc-append-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-wc/append/1k duration 297.60 (±10.20 ms) 311.00 (±18.00 ms) +13.4ms (4.5%) 👌
wc-clear-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-wc/clear/1k duration 23.95 (±2.45 ms) 25.20 (±2.15 ms) +1.3ms (5.2%) 👌
wc-create-10k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-wc/create/10k duration 4463.70 (±27.80 ms) 4552.50 (±34.75 ms) +88.8ms (2.0%) 👎
wc-create-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-wc/create/1k duration 267.25 (±5.30 ms) 268.75 (±8.05 ms) +1.5ms (0.6%) 👌
wc-update-10th-1k metric base(a5b99f1) target(d195bb8) trend
benchmark-table-wc/update-10th/1k duration 77.00 (±6.15 ms) 77.50 (±5.10 ms) +0.5ms (0.6%) 👌

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

I'm fine with this! It is a perf-regression in some degree, but probably very small because no everybody is using the template for the if condition.

<template>
<template if:true={hasParts}>
<template for:each={text} for:item="part">
<template if:true={part.highlight}>
Copy link
Member

Choose a reason for hiding this comment

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

Can we simplify this by removing part.highlight from the picture?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oddly enough, the bug does not exhibit when we remove this condition,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -458,15 +458,15 @@ export function f(items: any[]): any[] {
}
const len = items.length;
const flattened: VNodes = [];

// all flattened nodes should be marked as dynamic
Copy link
Member

Choose a reason for hiding this comment

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

Why is that?


it('should not render duplicate text', function () {
browser.click('integration-duplicate-text-rendering');
assert.deepEqual(browser.getText('integration-duplicate-text-rendering'), 'b');
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth adding an assert.notDeepEqual() here, or maybe a comment that describes the issue that these changes fix? I'm just curious about what was actually being rendered.

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: a5b99f1 | Target commit: b7829b5

lwc-engine-benchmark

table-append-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table/append/1k duration 158.05 (±4.25 ms) 154.40 (±4.45 ms) -3.7ms (2.3%) 👍
table-clear-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table/clear/1k duration 6.40 (±0.45 ms) 6.45 (±0.45 ms) +0.0ms (0.8%) 👌
table-create-10k metric base(a5b99f1) target(b7829b5) trend
benchmark-table/create/10k duration 922.15 (±8.70 ms) 923.50 (±6.40 ms) +1.3ms (0.1%) 👌
table-create-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table/create/1k duration 122.05 (±3.15 ms) 120.20 (±4.10 ms) -1.8ms (1.5%) 👌
table-update-10th-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table/update-10th/1k duration 79.00 (±2.65 ms) 79.95 (±2.70 ms) +1.0ms (1.2%) 👌
tablecmp-append-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-component/append/1k duration 260.75 (±7.05 ms) 266.80 (±7.25 ms) +6.1ms (2.3%) 👎
tablecmp-clear-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-component/clear/1k duration 12.20 (±1.75 ms) 12.35 (±1.20 ms) +0.2ms (1.2%) 👌
tablecmp-create-10k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-component/create/10k duration 1811.95 (±15.75 ms) 1844.70 (±12.55 ms) +32.8ms (1.8%) 👎
tablecmp-create-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-component/create/1k duration 211.35 (±5.40 ms) 215.90 (±4.20 ms) +4.5ms (2.2%) 👎
tablecmp-update-10th-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-component/update-10th/1k duration 72.50 (±4.15 ms) 74.30 (±4.25 ms) +1.8ms (2.5%) 👌
wc-append-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-wc/append/1k duration 297.60 (±10.20 ms) 296.75 (±10.80 ms) -0.9ms (0.3%) 👌
wc-clear-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-wc/clear/1k duration 23.95 (±2.45 ms) 24.20 (±2.65 ms) +0.3ms (1.0%) 👌
wc-create-10k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-wc/create/10k duration 4463.70 (±27.80 ms) 4481.50 (±30.90 ms) +17.8ms (0.4%) 👎
wc-create-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-wc/create/1k duration 267.25 (±5.30 ms) 265.45 (±5.80 ms) -1.8ms (0.7%) 👌
wc-update-10th-1k metric base(a5b99f1) target(b7829b5) trend
benchmark-table-wc/update-10th/1k duration 77.00 (±6.15 ms) 80.20 (±6.65 ms) +3.2ms (4.2%) 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: a5b99f1 | Target commit: 44cbf3f

lwc-engine-benchmark

table-append-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table/append/1k duration 158.05 (±4.25 ms) 153.10 (±3.00 ms) -5.0ms (3.1%) 👍
table-clear-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table/clear/1k duration 6.40 (±0.45 ms) 6.60 (±0.45 ms) +0.2ms (3.1%) 👌
table-create-10k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table/create/10k duration 922.15 (±8.70 ms) 926.95 (±7.40 ms) +4.8ms (0.5%) 👎
table-create-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table/create/1k duration 122.05 (±3.15 ms) 119.05 (±2.80 ms) -3.0ms (2.5%) 👍
table-update-10th-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table/update-10th/1k duration 79.00 (±2.65 ms) 79.50 (±3.15 ms) +0.5ms (0.6%) 👌
tablecmp-append-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-component/append/1k duration 260.75 (±7.05 ms) 261.55 (±4.85 ms) +0.8ms (0.3%) 👌
tablecmp-clear-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-component/clear/1k duration 12.20 (±1.75 ms) 12.35 (±1.85 ms) +0.2ms (1.2%) 👌
tablecmp-create-10k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-component/create/10k duration 1811.95 (±15.75 ms) 1827.95 (±10.30 ms) +16.0ms (0.9%) 👎
tablecmp-create-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-component/create/1k duration 211.35 (±5.40 ms) 213.25 (±5.35 ms) +1.9ms (0.9%) 👌
tablecmp-update-10th-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-component/update-10th/1k duration 72.50 (±4.15 ms) 76.80 (±6.15 ms) +4.3ms (5.9%) 👎
wc-append-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-wc/append/1k duration 297.60 (±10.20 ms) 289.45 (±14.40 ms) -8.2ms (2.7%) 👍
wc-clear-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-wc/clear/1k duration 23.95 (±2.45 ms) 25.50 (±2.50 ms) +1.6ms (6.5%) 👌
wc-create-10k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-wc/create/10k duration 4463.70 (±27.80 ms) 4441.20 (±25.65 ms) -22.5ms (0.5%) 👌
wc-create-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-wc/create/1k duration 267.25 (±5.30 ms) 271.60 (±4.70 ms) +4.4ms (1.6%) 👎
wc-update-10th-1k metric base(a5b99f1) target(44cbf3f) trend
benchmark-table-wc/update-10th/1k duration 77.00 (±6.15 ms) 76.90 (±6.35 ms) -0.1ms (0.1%) 👌

@davidturissini davidturissini merged commit 958201c into master Nov 8, 2018
@davidturissini davidturissini deleted the dturissini/duplicate-text-rendering branch November 8, 2018 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants