More information on Forced Synchronous Layout

63 views
Skip to first unread message

Mohan Radhakrishnan

unread,
Mar 23, 2015, 2:30:32 AM3/23/15
to google-chrome-...@googlegroups.com
Hi,
        Is there more information to address the bottleneck ?

Thanks,
Mohan
Forced Synchronous Layout.PNG

Andrey Kosyakov

unread,
Mar 23, 2015, 9:22:04 AM3/23/15
to Google Chrome Developer Tools
This means you're accessing some layout-dependent property of a DOM element (e.g. offsetWidth/offsetHeight) that causes layout to be performed instantly upon access, as opposed to the normal flow when it's done after all your JS event handlers are complete and frame is about to be actually painted. You can ignore it if it only happens once and does not take much time, but if it's done within a loop and your DOM tree is large, the performance effects can be drastic. To avoid repetitive relayouts you basically need to stop interleaving DOM writes and reads -- so cache the layout-dependent properties of interest first, then update the DOM. 

Best regards,
Andrey.

Paul Irish

unread,
Mar 23, 2015, 6:37:26 PM3/23/15
to Google Chrome Developer Tools
We need to get information like this into the tool.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/CABapexezbo4eR%2BWoVFhGfmV4Cind0GH2L5RsTusQb_%2B8ug%2BoUA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Jason Laster

unread,
Mar 23, 2015, 11:59:25 PM3/23/15
to google-chrome-...@googlegroups.com
Is this write up appropriate? 
http://www.kellegous.com/j/2013/01/26/layout-performance/


For more options, visit https://groups.google.com/d/optout.


--

-- 
Jason Laster
Software Engineer
  Etsy  


Paul Irish

unread,
Mar 24, 2015, 12:24:28 AM3/24/15
to Google Chrome Developer Tools
Yup, that works. Any article on "layout thrashing" covers things. 

Our challenge is to connect to the action-oriented advice in there.

Reply all
Reply to author
Forward
0 new messages