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

feat(proxy-compat): Add disable compat transform pragma #24

Merged
merged 2 commits into from
Feb 1, 2018

Conversation

pmdartus
Copy link
Member

Changes

This PR introduces a way to disable proxy-compat transformation for specific files using the /* proxy-compat-disable */ comment. This comment is meant to be used on javascript modules that are performance sensitive, and that never manipulate Proxy.

For example:

/* proxy-compat-disable */
 
function palindrome(str) {
    return str === str.split('').reverse().join('');
}

PR Checklist

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe: Perf

Does this PR introduce a breaking change?

  • Yes
  • No

@salesforce-best-lwc-internal
Copy link

Benchmark comparison

Base commit: 0a8e11f | Target commit: 8b5a691

benchmark base(0a8e11f) target(8b5a691) trend
append-1k.benchmark:benchmark-table/add/1k 335.93 (± 9.90 ms) 372.50 (± 9.90 ms) 👎
clear-1k.benchmark:benchmark-table/clear/1k 51.34 (± 2.60 ms) 57.09 (± 2.60 ms) 👎
create-1k.benchmark:benchmark-table/create/1k 199.85 (± 6.93 ms) 214.88 (± 6.93 ms) 👎
update-10th-1k.benchmark:benchmark-table/update-10th/1k 182.35 (± 9.33 ms) 207.27 (± 9.33 ms) 👎

@salesforce-best-lwc-internal
Copy link

Benchmark comparison

Base commit: 29cb560 | Target commit: f715f1a

benchmark base(29cb560) target(f715f1a) trend

@@ -223,7 +223,7 @@ describe('mode generation', () => {
});
});

it('handles compat mode', async () => {
it.only('handles compat mode', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we really want to run this only?

@salesforce-best-lwc-internal
Copy link

Benchmark comparison

Base commit: 29cb560 | Target commit: aabab12

benchmark base(29cb560) target(aabab12) trend

@pmdartus pmdartus merged commit f10d033 into master Feb 1, 2018
@pmdartus pmdartus deleted the pmdartus/no-compat-pragma branch February 1, 2018 17:59
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.

2 participants