On 3/3/14 5:38 PM, Robert O'Callahan wrote:
Wouldn't a deep clone of the root element be more efficient?

Possibly, yes. Of course if you plan to do processing on a worker you then have to serialize parts or all of the clone....

Anyway, I just did some measurements. On a year+ old laptop, on Mac, I see numbers like so:

http://www.cnn.com/ :
  document.documentElement.innerHTML: ~5ms
  document.documentElement.cloneNode(true): ~18ms
  document.cloneNode(true): ~8ms

http://www.whatwg.org/specs/web-apps/current-work/ :
  document.documentElement.innerHTML: ~200ms
  document.documentElement.cloneNode(true): ~300ms
  document.cloneNode(true): ~300ms

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to