Ticket #2532236 (closed enhancement)
Reporternuria |
Opened: 05/1/12 Last modified: 08/1/12 Status: closed Type: enhancement Resolution: fixed |
Owner Dav Glass |
Target Release: 3.6.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Performance problems on YUI().use on FF3.6 and IE8 | ||
| Description: | We have recently upgraded YUI to its latest version to find that for FF 3.6 and IE8 is much slower to call YUI().use than it was on YUI3.4. We are aware that there is functionality on 3.5 that did not The problem comes with the _inspectPage method in the YUI object. This method builds everytime the instance is called the dependency tree, there is no caching whatsoever among instances. As far as I 1) Use YUI().use('whatever-module') There is no method to remove dependencies, then, it seems that caching of what has been already loaded should happen across YUI instances. If a module is loaded is loaded "for ever", thus why do we |
||
| Type: | enhancement | Observed in Version: | 3.5.0 |
| Component: | Loader | Severity: | S3 (normal) |
| Assigned To: | Dav Glass | Target Release: | 3.6.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | Firefox 3.x - All,IE 8.x | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 05/1/12
|
|
Posted: 05/1/12
|
|
Posted: 05/1/12
I think executing YUI.use about , say, 20 times in each browser is sufficient. Not the same 'use' but rather 20 different YUI.use in sequence. Like YUI.use('module-1',function (Y){//does something}); YUI.use('module-2',function (Y){//does something}); YUI.use('module-20',function (Y){//does something}); Our YUI config is like this: {"cdn":"http://static.tuenti.com/?","base":"http://static.tuenti.com/?","comboBase":"http://static.tuenti.com/?","combine":true,"root":"","filter":"min","lang":"es-ES"} |
|
Posted: 05/1/12
|
|
Posted: 05/1/12
So you're creating 20+ YUI instances in your application? We don't specifically test that use case because it's not recommended and totally not performant and never will be. You should limit your instances to as few as possible, not only for performance but from a memory standpoint alone. A YUI instance costs memory when created, so when you create dozens you are just asking for your own trouble. I will investigate this issue, but it's not a high priority since it's not a recommended practice and never was intended to be used in this fashion. |
|
Posted: 05/1/12
We do YUI().use about 20 times more or less and I understand that this is not your base use case but regardless, once modules have loaded they cannot be "unloaded" so it seems that it will be worth it to have a static cache of modules loaded that the instances share. |
|
Posted: 05/11/12
|
|
Posted: 05/15/12
|
|
Posted: 05/15/12
Fixes #2532236 - Added caching to isCSSLoaded This enhancement shaves 3-4 seconds off the loader |
|
Posted: 08/1/12
Shipped in 3.6.0. Marking closed/fixed. |
Jenny Donnelly
I'll look into this, but I asked for a repro case. My tests all execute in a normal time frame in all browsers that I test against. I'm not seeing this dramatic "slow down", so please attach a repro case not an explaination of the code.