Ticket #2529337 (closed enhancement)
Reporter Eduardo Lundgren |
Opened: 09/19/10 Last modified: 08/1/12 Status: closed Type: enhancement Resolution: fixed |
Owner Satyen Desai |
Target Release: 3.6.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Attribute valueFn being called unnecessarily when HTML_PARSER find a Node or NodeList | ||
| Description: | Attribute valueFn being called unecessarly when HTML_PARSER find a Node or NodeList. If some Node or NodeList is found there is no reason to the default value of the attribute be initialized. For instance: ATTRS: { HTML_PARSER: { If the HTML_PARSER for myTitleNode query find something the valueFn of the respective attribute is called unnecessarily. The HTML_PARSER value should prevent this to be called and a performance gain might happen. On the method _getAttrInitVal on Attribute.js could check if there is a simple value for that attribute before call the sugar valueFn: ...if (valFn) { if (!Y.Lang.isValue(initValues.simple[attr])) { val = valFn.call(this); } } ... |
||
| Type: | enhancement | Observed in Version: | 3.2.0 |
| Component: | Widget | Severity: | S3 (normal) |
| Assigned To: | Satyen Desai | Target Release: | 3.6.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 09/20/10
|
|
Posted: 01/24/11
|
|
Posted: 07/27/11
These are backlog bugs which didn't make it into any of the 3.4.0 sprints. Marking as 3.5.0 backlog for evaluation going into 3.5.0 sprint 1 |
|
Posted: 11/8/11
|
|
Posted: 11/8/11
Need to move to Sprint 2 |
|
Posted: 11/8/11
|
|
Posted: 11/8/11
Need to move to Sprint 2 |
|
Posted: 12/12/11
|
|
Posted: 01/31/12
Need to move out of 3.5.0 Sprint 3 - Only 50% allocation this sprint. |
|
Posted: 04/4/12
|
|
Posted: 04/4/12
As part of this optimization, I will also be looking at allowing value to override valueFn, if value comes from a subclass (https://github.com/yui/yui3/wiki/Attribute-Wishlist) |
|
Posted: 05/8/12
Need to move to Sprint 2, since Sprint 1 ended up going mostly towards 3.5.1 |
|
Posted: 05/19/12
Here's the fix for this issue and the test, on my github fork, if you want to take a look. https://github.com/sdesai/yui3/blob/master/build/attribute-complex/attribute-complex.js#L75 Not closing this out yet because: a) Want to add a Widget HTML_PARSER test, although it should amount to the same scenario as tested above. |
|
Posted: 05/19/12
|
|
Posted: 05/19/12
Also provided the solution required Y.App : to allow value in a subclass overide valueFn defined higher up in the hierarchy. Will merge into master after a little more testing |
|
Posted: 05/19/12
Commited to my github fork. Will merge to master after testing a couple of the examples. Unit tests pass. https://github.com/sdesai/yui3/blob/master/src/base/tests/base-core-tests.js#L457 |
|
Posted: 06/1/12
Optimized valueFn handling, so that valueFn is not called if user provides a value. This was true for AttributeCore already, but this optimization was missed for Also refactored tests into separate HTML and JS files, moving towards travis See #2529337 Not closing the bug out yet, since I also want to add the ability |
|
Posted: 06/1/12
|
|
Posted: 08/1/12
Shipped in 3.6.0. Marking closed/fixed. |
Marking 3.NEXT for now as discussed. May get it into 3.3. however, depending on how other work pans out, or if it's a major impact in terms of performance.