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 for 2348 and 2344 #2349

Merged
merged 1 commit into from
Feb 13, 2016
Merged

Fix for 2348 and 2344 #2349

merged 1 commit into from
Feb 13, 2016

Conversation

nazar-pc
Copy link
Contributor

Fix for getters/setters for property become inaccessible when propery set on element before it is ready
Did not succeed in creating test case this time:(
Fixes #2348

@nazar-pc nazar-pc changed the title Fix for 2348 Fix for 2348 and 2344 Aug 23, 2015
@nazar-pc
Copy link
Contributor Author

Indeed it fixes #2344 as well...

@tjsavage
Copy link
Contributor

added @sjmiles to take a look on this as he was active on the corresponding issue

nazar-pc added a commit to nazar-pc/CleverStyle-Framework that referenced this pull request Oct 8, 2015
nazar-pc added a commit to nazar-pc/CleverStyle-Framework that referenced this pull request Nov 1, 2015
nazar-pc added a commit to nazar-pc/CleverStyle-Framework that referenced this pull request Nov 6, 2015
nazar-pc added a commit to nazar-pc/CleverStyle-Framework that referenced this pull request Nov 13, 2015
nazar-pc added a commit to nazar-pc/CleverStyle-Framework that referenced this pull request Dec 18, 2015
List of patches applied on top of git version (4 previous patches upstreamed and one fixed by alternative patch, yay!):
* Polymer/polymer#2205
* Polymer/polymer#2247
* Polymer/polymer#2349
* Polymer/polymer#2419
* Polymer/polymer#3215
@@ -121,6 +121,9 @@
value = value.call(this, this._config);
}
config[i] = value;
} else if (this.hasOwnProperty(i)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this[i] !== undefined should be faster than hasOwnProperty.

@sorvell
Copy link
Contributor

sorvell commented Jan 28, 2016

Sorry for the time lag on this. The main concern with this change is incurring a performance penalty on elements that do not have early-set properties. Would you be willing to do some performance testing on this? Thank.

@nazar-pc
Copy link
Contributor Author

Modified as you suggested.
About performance: created 10 elements with 300 String properties there, 10 instances of each element on page (30k properties in total, all passing through newly added code).

Without patch readystatechange took 45.56ms in Chromium, with patch 79.45ms. This is 1.74 times slower, but since this step is executed only once for each element and takes so small amount of time even for 300 properties this is an affordable change.

Code I've used for testing: http://pastebin.com/ZdMnrZqN

@@ -121,6 +121,9 @@
value = value.call(this, this._config);
}
config[i] = value;
} else if (this[i] !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the check if and the else if should be switched here. If there's an existing value, we should take that and not the default value.

@sorvell
Copy link
Contributor

sorvell commented Jan 29, 2016

We plan to do some perf testing to see what overhead this adds to elements without early-property sets.

@nazar-pc
Copy link
Contributor Author

Modified as suggested

nazar-pc added a commit to nazar-pc/CleverStyle-Framework that referenced this pull request Feb 1, 2016
@sorvell sorvell added the p0 label Feb 3, 2016
@sorvell sorvell assigned sorvell and unassigned sjmiles Feb 3, 2016
@sorvell
Copy link
Contributor

sorvell commented Feb 4, 2016

The performance of this change looks ok to me. Can you please add a test? Thanks.

@sorvell sorvell removed the p0 label Feb 4, 2016
…y set on element before it is ready

Test added
@nazar-pc
Copy link
Contributor Author

nazar-pc commented Feb 5, 2016

@sorvell, I've managed to write test for this change, also rebased against master

@kevinpschaaf kevinpschaaf merged commit ecd9b09 into Polymer:master Feb 13, 2016
@nazar-pc nazar-pc deleted the fix-for-2348 branch February 25, 2016 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants