yui/yui3 — pull request #1773 by ezequiel (2014-04-09 22:37:33+00:00)
Title: [DOM]: Don't cache throw away elements.

Whenever you use `Y.Node.create` or the like, it'll create a "dummy" element under the hood to do its work on. This dummy element is cached in `_fragClones`, while it's children are intermittently removed later on. Since this dummy element is never cleared from the cache, a small (potentially) memory leak is caused.

I suppose the idea behind caching dummy elements in `_fragClones` was to avoid the constant creation of these elements when using `Y.Node.create`.

If you look closely, `cloneNode(false)` is called if the particular dummy element is found in the cache. Shallow cloning an element is hardly faster than simply creating it from scratch. The difference in speed is in the noise. See: http://jsperf.com/clone-vs-create-part-deux

I rather us avoid caching the dummy element to avoid the memory leak all together since speed is not a factor.