L20n/Firefox/Performance: Difference between revisions

Jump to navigation Jump to search
m
(H5: Lazy-to-actual)
Line 74: Line 74:
Are we working against XUL layout optimizations?  XUL elements are first created as XULPrototypeElements which only carry just enough information to be useful for layout.  When they're accessed from JS code they are converted to actual XULElements.  The hypothesis is that there are at least two things when creating a new browser.xul window that trigger this conversion before tpaint: our code and something else, let's call it X.  The first piece of code to make the call pays the lazy-to-actual tax.  If it's us (because we start very early, like when we trigger on MozBeforeLayout), we take a lot of time (see Hypothesis 2!), but still finish pretty early, then X runs faster and tpaint happens in 270 ms (on stas's machine).  If it's not us (like when we trigger on DOMContentLoaded) then X takes more time; we run later but finish faster (we take 20 ms to translate everything), and... tpaint hapens in 270 ms.  For tpaint it only matters if the tax has been paid.  Below are the rough numbers in milliseconds:
Are we working against XUL layout optimizations?  XUL elements are first created as XULPrototypeElements which only carry just enough information to be useful for layout.  When they're accessed from JS code they are converted to actual XULElements.  The hypothesis is that there are at least two things when creating a new browser.xul window that trigger this conversion before tpaint: our code and something else, let's call it X.  The first piece of code to make the call pays the lazy-to-actual tax.  If it's us (because we start very early, like when we trigger on MozBeforeLayout), we take a lot of time (see Hypothesis 2!), but still finish pretty early, then X runs faster and tpaint happens in 270 ms (on stas's machine).  If it's not us (like when we trigger on DOMContentLoaded) then X takes more time; we run later but finish faster (we take 20 ms to translate everything), and... tpaint hapens in 270 ms.  For tpaint it only matters if the tax has been paid.  Below are the rough numbers in milliseconds:


   '''Trigger             l20n-start  io-start  io-end  trigger/translateRoot-start  formatting-start (async)  formatting-end  translateRoot-end  tpaint
   Trigger                 l20n-start  io-start  io-end  trigger/translateRoot-start  formatting-start (async)  formatting-end  translateRoot-end  tpaint
   DOMContentLoaded               35        40    140                          160                      165            175                180    270
  ------------------------------------------------------------------------------------------------------------------------------------------------------
   MozBeforeLayout                 8        10      35                          40                        65            135                140    270
   DOMContentLoaded               35        40    140                          160                      165            175                180    270
   MozBeforeLayout                 8        10      35                          40                        65            135                140    270
canmove, Confirmed users
1,448

edits

Navigation menu