Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In the dev tools timeline, what are the empty green rectangles?

In the Chrome dev tools timeline, what is the difference between the filled, green rectangles (which represent paint operations) and the empty, green rectangles (which apparently also represent something about paint operations...)?

enter image description here

like image 439
Levi Lindsey Avatar asked Dec 10 '14 01:12

Levi Lindsey


People also ask

What does purple mean in dev tools?

It is white space. For example you have a container with 100% of width and two divs inside, one of those with 50% and another width 40% of width, it means that there is 10% of space empty... this 10% would be shown in this purple dashed line area by the Google inspector.

What is idle time in Chrome performance?

This is idle time, the time when the browser is waiting on the CPU or GPU to do some processing. It is shown in the pie chart screenshot in the documentation page How to Use the Timeline Tool.

What does close dev tools mean?

If the DevTools window is undocked in a separate window, Ctrl W will close it if it is the active window. You can use Ctrl Shift D to toggle between a docked and undocked DevTools window. So if the window is undocked, you can quickly press Ctrl Shift D , I to close it. More shortcuts here.


1 Answers

Painting is really two tasks: draw calls and rasterization.

  • Draw calls. This is a list of things you'd like to draw, and its derived from the CSS applied to your elements. Ultimately there is a list of draw calls not dissimilar to the Canvas element's: moveTo, lineTo, fillRect (though they have slightly different names in Skia, Chrome's painting backend, it's a similar concept.)
  • Rasterization. The process of stepping through those draw calls and filling out actual pixels into buffers that can be uploaded to the GPU for compositing.

So, with that background, here we go:

  • The solid green blocks are the draw calls being recorded by Chrome. These are done on the main thread alongside JavaScript, style calculations, and layout. These draw calls are grouped together as a data structure and passed to the compositor thread.
  • The empty green blocks are the rasterization. These are handled by a worker thread spawned by the compositor.

Essentially, then, both are paint, they just represent different sub-tasks of the overall job. If you're having performance issues (and from the grab you provided you appear to be paint bound), then you may need to examine what properties you're changing via CSS or JavaScript and see if there is a compositor-only way to achieve the same ends. CSS Triggers can probably help here.

like image 191
Paul Lewis Avatar answered Sep 22 '22 00:09

Paul Lewis