On Feb 17, 2014 7:23 AM, "Julien Wajsberg" <[email protected]> wrote: > > Le 17/02/2014 02:09, Jim Porter a écrit : > > On 02/16/2014 07:22 AM, Prateek Jadhwani wrote: > >> I have been working on Gaia's Lazy Loader part for quite some time. > >> And here are my findings. > >> > >> http://prateekjadhwani.com/wp/?p=751 > >> > >> Please let me know, what do you guys think about it. Let me know if I > >> am wrong somewhere, or the article needs improvement. Or any > >> remarks. > > > > Note: I'm not on the performance team, so take what I say with a grain > > of salt, although I'm pretty sure my beliefs are correct in this case. > > > > That said, this part is wrong, as far as I know: > > > > "These series of appends of resources are never ever removed from the > > HTML files after their use. Instead, they stay there, hogging > > resources, until and unless the cell phone is restarted." > > Moreover, AFAIK, removing a script element never removes the objects it > loaded. > Although this could be done with some code, this is exactly what Haida > is trying to resolve too.
There is no way to "undo" the actions that a <script> did when it was originally run. And it wouldn't be webcompatible even if we could. But if you want to release objects, normal JS rules apply. I.e. if you drop all references to an object then it will br GCed. If you ensure that the only references to an object is from the script element itself, I.e. if the script doesn't set any properties on the window but rather on the script element, then those properties will be released when the script element is GCed. / Jonas _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
