Advertisment

Learn Some Ways you May Improve Your Website's Scrolling Performance?

 Some Ways you May Improve Your Website's Scrolling Performance?

First of all we should consider what happens when we scroll?

The reason is very simple when we scroll the browser needs to draw our site or application to the screen. So we need to done our work in minimum time and maximum performance. When we scroll the browser see in styled Dom and collect all related things that are same and move a picture of them which is called a layer. Each layer needs to painted and rasterized to a texture and then composited together to the  image that we see on screen.so the result is that

“Less painting is better”

How this workout in Practice
                                If we open up the timeline panel, set it to frame mood, hit the record button and then start scrolling. We shall see many bars colored green. In the list we see whole heap of paint records. This is chrome painting and Rasterizing the texture for the composite layer. In chrome’s Dev. tools setting which can be accessed through the little icon in bottom right corner?

We should be looking for the smallest possible paint areas are in the whole screen and performance very tough. The reason is that chrome has many damage regions. In this case the thin 100% wide strip with the bottom. It was draw in the same composite layer, all which is together in a region 100% wide and 100% high. If we disable the side menu using the check box at the top and scroll again we will see that the only repainting work that needs to be performed is the thin strip along the bottom and it all happen very quickly.
If we want to see a real world example of this action try to load Google+ And then change the side navigation over from position: fixed to position absolute.

Image Resizes

If we resize the picture that we download and up load then we see that some of the paint records will allow us to twizzle down for more record. If we do test that some records are resize. This is exactly what it says to tin; the browser has to resize the image as part of its paint work.

There are some other things that impact our scrolling performance.

·         Expensive style

·         Reflows and repaint

·         Failing to debunking our scroll events
Share on Google Plus

About bilal S

I am founder of javaHint.com and a Computer Scientist. I have studied Computer Science and currently enrolled research student .I am providing information about computer, s web Programming Languages, Architecture and All other basic information Such as Information Technology and Computer Science. For Any Query and suggestion you are always welcome to contact me.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment