SlideShare una empresa de Scribd logo
1 de 58
Descargar para leer sin conexión
Considering Tiling for a
better User Experience

Kenneth Rohde Christiansen
WebKit Code Camp, Wiesbaden, December 2009
SOMETHING THAT I HAVE BEEN WORKING ON
SOMETHING THAT I HAVE BEEN WORKING ON

WHO AM I?
SOMETHING THAT I HAVE BEEN WORKING ON

WHO AM I? KENNETH R. CHRISTIANSEN
SOMETHING THAT I HAVE BEEN WORKING ON

WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER
SOMETHING THAT I HAVE BEEN WORKING ON

WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER
1+ YEAR WORKING WITH WEBKIT
SOMETHING THAT I HAVE BEEN WORKING ON

WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER
1+ YEAR WORKING WITH WEBKIT 3+ YEARS WORKING WITH
APP & FRAMEWORK DEVELOPMENT AT
SOMETHING THAT I HAVE BEEN WORKING ON

WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER
1+ YEAR WORKING WITH WEBKIT 3+ YEARS WORKING WITH
APP & FRAMEWORK DEVELOPMENT AT NOKIA TECHNOLOGY
INSTITUTE, INdT, RECIFE, BRAZIL
A TILED
BACKING STORE
What are the problems we are facing today?
The background for considering tiling
What are the problems we are facing today?
The background for considering tiling




            WE PAINT THINGS WE’VE
            ALREADY PAINTED WHEN
              SCROLLING BACK
What are the problems we are facing today?
The background for considering tiling




                                          WE CALL INTO
                                        WEBCORE FOR EACH
            WE PAINT THINGS WE’VE
                                             PAINT...
            ALREADY PAINTED WHEN
              SCROLLING BACK
What are the problems we are facing today?
The background for considering tiling




                                          WE CALL INTO
                                        WEBCORE FOR EACH
            WE PAINT THINGS WE’VE
                                             PAINT...
            ALREADY PAINTED WHEN
              SCROLLING BACK




                 ...CALLING
              INTO WEBCORE
                HAS SOME
               OVERHEAD
What are the problems we are facing today?
The background for considering tiling




                                                          WE CALL INTO
                                                        WEBCORE FOR EACH
            WE PAINT THINGS WE’VE
                                                             PAINT...
            ALREADY PAINTED WHEN
              SCROLLING BACK



                                            FOR INSTANCE,
                                        CONSTRUCTING GRAPHICS
                                            CONTEXT IS QUITE
                                               EXPENSIVE
                 ...CALLING
              INTO WEBCORE
                HAS SOME
               OVERHEAD
What are the problems we are facing today?
The background for considering tiling




                                                          WE CALL INTO
                                                        WEBCORE FOR EACH
            WE PAINT THINGS WE’VE
                                                             PAINT...
            ALREADY PAINTED WHEN
              SCROLLING BACK



                                            FOR INSTANCE,
                                        CONSTRUCTING GRAPHICS
                                            CONTEXT IS QUITE
                                               EXPENSIVE
                 ...CALLING
              INTO WEBCORE
                HAS SOME
               OVERHEAD
                                                          CLEVER TILING CAN
                                                          SOLVE THESE
                                                          ISSUES
How to accomplish this
What is tiling anyway?




  Cache and join paint
  events
How to accomplish this
What is tiling anyway?




  Cache and join paint
  events
                         Cache what you paint in image tiles
How to accomplish this
What is tiling anyway?




  Cache and join paint
  events
                         Cache what you paint in image tiles
                         Blit the existing tiles on scroll
How to accomplish this
What is tiling anyway?




  Cache and join paint
  events
                         Cache what you paint in image tiles
                         Blit the existing tiles on scroll
                         Don’t paint non-visible dirty areas immediately
How to accomplish this
What is tiling anyway?




  Cache and join paint
  events
                         Cache what you paint in image tiles
                         Blit the existing tiles on scroll
                         Don’t paint non-visible dirty areas immediately
                         Avoid too many small tiles, due to the cost of
                         constructing GraphicsContexts
How to accomplish this
What is tiling anyway?




  Cache and join paint
  events
                         Cache what you paint in image tiles
                         Blit the existing tiles on scroll
                         Don’t paint non-visible dirty areas immediately
                         Avoid too many small tiles, due to the cost of
                         constructing GraphicsContexts
                         This can be hardware accelerated!
My experiment
My basic algorithm



    As an experiment, implement it on the WebKit side
My experiment
My basic algorithm



    As an experiment, implement it on the WebKit side
        Implemented only for QGraphicsWebView
My experiment
My basic algorithm



    As an experiment, implement it on the WebKit side
        Implemented only for QGraphicsWebView
        Some changes needed elsewhere:
            1) Render methods in abs. coordinates, without clipping
My experiment
My basic algorithm



    As an experiment, implement it on the WebKit side
        Implemented only for QGraphicsWebView
        Some changes needed elsewhere:
            1) Render methods in abs. coordinates, without clipping
            2) Make ScrollView / FrameView send update events
               outside of the viewport
My experiment
My basic algorithm



    As an experiment, implement it on the WebKit side
        Implemented only for QGraphicsWebView
        Some changes needed elsewhere:
            1) Render methods in abs. coordinates, without clipping
            2) Make ScrollView / FrameView send update events
               outside of the viewport

         Why not just make viewport == contents size?
My experiment
My basic algorithm



    As an experiment, implement it on the WebKit side
        Implemented only for QGraphicsWebView
        Some changes needed elsewhere:
            1) Render methods in abs. coordinates, without clipping
            2) Make ScrollView / FrameView send update events
               outside of the viewport

         Why not just make viewport == contents size?
          Because we use WebCore for drawing our scrollbars
          and that makes a whole lot of sense ... theming ... etc
My experiment
My basic algorithm



    Basic algorithm
My experiment
My basic algorithm



    Basic algorithm

        If not in cache, paint the dirty area as a tile, enlarge it
        slightly (64 pixels in each direction)
My experiment
My basic algorithm



    Basic algorithm

        If not in cache, paint the dirty area as a tile, enlarge it
        slightly (64 pixels in each direction)
        Put in cache, blit to screen
My experiment
My basic algorithm



    Basic algorithm

        If not in cache, paint the dirty area as a tile, enlarge it
        slightly (64 pixels in each direction)
        Put in cache, blit to screen

        Each tile stores it’s covered area as well as a dirty area.
My experiment
My basic algorithm



    Basic algorithm

        If not in cache, paint the dirty area as a tile, enlarge it
        slightly (64 pixels in each direction)
        Put in cache, blit to screen

        Each tile stores it’s covered area as well as a dirty area.
        On update, we update the dirty area of the intersected
        tiles. If it has such an area already, the bounding rect
        is uses as the new area. Remember, we try to avoid
        calling into WebCore unnecessarily
My experiment
My basic algorithm



    Basic algorithm

        If not in cache, paint the dirty area as a tile, enlarge it
        slightly (64 pixels in each direction)
        Put in cache, blit to screen

        Each tile stores it’s covered area as well as a dirty area.
        On update, we update the dirty area of the intersected
        tiles. If it has such an area already, the bounding rect
        is uses as the new area. Remember, we try to avoid
        calling into WebCore unnecessarily

        Furthermore, if the dirty area == covered area, remove it from cache
My experiment
My basic algorithm



    Basic algorithm
My experiment
My basic algorithm



    Basic algorithm

        On update and scroll:
        Update all tiles, blit what is in the cache, create tiles for
        what is not
My experiment
My basic algorithm



    Basic algorithm

        On update and scroll:
        Update all tiles, blit what is in the cache, create tiles for
        what is not




        That is more of less the basic algorithm, but there are
        some problems.
My experiment
My basic algorithm



    Problems
My experiment
My basic algorithm



    Problems

        Scrollbars
        Paint the scrollbars separately, make sure updates to
        them do not invalidate any tiles. These are not tiled in
        my implementation!
My experiment
My basic algorithm



    Problems

        Scrollbars
        Paint the scrollbars separately, make sure updates to
        them do not invalidate any tiles. These are not tiled in
        my implementation!

        Enlarging tiles
        When enlarging we much make sure that we don’t
        cover an area already in the cache, so I need to know
        what area is cached.
My experiment
My basic algorithm



    Problems
My experiment
My basic algorithm



    Problems

        Cache growth
        Storing the whole page in the cache would be
        expensive, memory-wise, so the cache has a max size.
My experiment
My basic algorithm



    Problems

        Cache growth
        Storing the whole page in the cache would be
        expensive, memory-wise, so the cache has a max size.
        The solution is to give each tile an age and increase
        the age when not used, and reset it when being blit.
My experiment
My basic algorithm



    Problems

        Cache growth
        Storing the whole page in the cache would be
        expensive, memory-wise, so the cache has a max size.
        The solution is to give each tile an age and increase
        the age when not used, and reset it when being blit.
        Before adding a new tile, we reserve the needed
        space for it, removing the oldest tiles.
So what is the preliminary results?
Did it really pay off?



      Benjamin wrote a simple scrolling test app, and the
      results are quite promising.
So what is the preliminary results?
Did it really pay off?



      Benjamin wrote a simple scrolling test app, and the
      results are quite promising.

                   QWEBVIEW PERFORMS
                  RESONABLE, DUE TO THE
                      XCOPYREGION
So what is the preliminary results?
Did it really pay off?



      Benjamin wrote a simple scrolling test app, and the
      results are quite promising.

                   QWEBVIEW PERFORMS
                                          THE TILING IS FASTER!
                  RESONABLE, DUE TO THE
                      XCOPYREGION
So what is the preliminary results?
Did it really pay off?



      Benjamin wrote a simple scrolling test app, and the
      results are quite promising.

                   QWEBVIEW PERFORMS
                                                          THE TILING IS FASTER!
                  RESONABLE, DUE TO THE
                      XCOPYREGION



       But we had some surprises as well.


                                          NON-TILED
                                    QGRAPHICSWEBVIEW IS
                                     EXTREMELY SLOW
Where are se’ numbers?
Back up your claims dude!




     Simple painting


               QWebView



      QGraphicsWebView



Tiled QGraphicsWebView


                            0   2,5   5,0   7,5            10,0


                                                  Milliseconds
Where are se’ numbers?
Back up your claims dude!




     Slashdot page


               QWebView



      QGraphicsWebView



Tiled QGraphicsWebView


                            0   25   50   75            100


                                               Milliseconds
Where are se’ numbers?
Back up your claims dude!




     Amazon book page


               QWebView



      QGraphicsWebView



Tiled QGraphicsWebView


                            0   22,5   45,0   67,5            90,0


                                                     Milliseconds
Where are se’ numbers?
Back up your claims dude!




     Wikipedia Qt page


               QWebView



      QGraphicsWebView



Tiled QGraphicsWebView


                            0   37,5   75,0   112,5           150,0


                                                      Milliseconds
Can’t you do better than that?
Ideas for improvement




    WE CAN!
Can’t you do better than that?
Ideas for improvement




    WE CAN!

       More realistic test suite!
Can’t you do better than that?
Ideas for improvement




    WE CAN!

       More realistic test suite!
       My data structures are not that good, nor profiled
Can’t you do better than that?
Ideas for improvement




    WE CAN!

       More realistic test suite!
       My data structures are not that good, nor profiled
       Should be lower in the stack using WebCore constructs
Can’t you do better than that?
Ideas for improvement




    WE CAN!

       More realistic test suite!
       My data structures are not that good, nor profiled
       Should be lower in the stack using WebCore constructs
       Paint in another thread, not block WebCore
Can’t you do better than that?
Ideas for improvement




    WE CAN!

       More realistic test suite!
       My data structures are not that good, nor profiled
       Should be lower in the stack using WebCore constructs
       Paint in another thread, not block WebCore



    That is why we are here ;-) Now let’s get on to the
    work!
Thanks for listening

KENNETH ROHDE CHRISTIANSEN
ext-kenneth.christiansen@nokia.com
kenneth.christiansen@openbossa.org

Más contenido relacionado

Destacado

Wall and floor tiling tools and equipment
Wall and floor tiling tools and equipmentWall and floor tiling tools and equipment
Wall and floor tiling tools and equipmentdeaftc232
 
Finishing works detail of residence building
Finishing works detail of residence buildingFinishing works detail of residence building
Finishing works detail of residence buildingshamal das
 
Building materials and construction technlogoy- FALSE CEILING & FLOORING
Building materials and construction technlogoy- FALSE CEILING & FLOORINGBuilding materials and construction technlogoy- FALSE CEILING & FLOORING
Building materials and construction technlogoy- FALSE CEILING & FLOORINGAishwarya Deopujari
 
All About Plumbing
All About PlumbingAll About Plumbing
All About Plumbingvortexcas
 
flooring and its types
flooring and its typesflooring and its types
flooring and its typesLakshay Sharma
 
What is Plumbing Tool and work of Plumbing Tools.
 What is Plumbing Tool and work of Plumbing Tools. What is Plumbing Tool and work of Plumbing Tools.
What is Plumbing Tool and work of Plumbing Tools.Tradusway12
 

Destacado (10)

Wall and floor tiling tools and equipment
Wall and floor tiling tools and equipmentWall and floor tiling tools and equipment
Wall and floor tiling tools and equipment
 
Designing with Tile
Designing with TileDesigning with Tile
Designing with Tile
 
Finishing works detail of residence building
Finishing works detail of residence buildingFinishing works detail of residence building
Finishing works detail of residence building
 
Building materials and construction technlogoy- FALSE CEILING & FLOORING
Building materials and construction technlogoy- FALSE CEILING & FLOORINGBuilding materials and construction technlogoy- FALSE CEILING & FLOORING
Building materials and construction technlogoy- FALSE CEILING & FLOORING
 
5S The Practice of Good Housekeeping
5S The Practice of Good Housekeeping5S The Practice of Good Housekeeping
5S The Practice of Good Housekeeping
 
All About Plumbing
All About PlumbingAll About Plumbing
All About Plumbing
 
Tiles presentation
Tiles presentationTiles presentation
Tiles presentation
 
Housekeeping ppt
Housekeeping pptHousekeeping ppt
Housekeeping ppt
 
flooring and its types
flooring and its typesflooring and its types
flooring and its types
 
What is Plumbing Tool and work of Plumbing Tools.
 What is Plumbing Tool and work of Plumbing Tools. What is Plumbing Tool and work of Plumbing Tools.
What is Plumbing Tool and work of Plumbing Tools.
 

Más de Kenneth Rohde Christiansen (11)

Progressive Web Apps - deep dive
Progressive Web Apps - deep diveProgressive Web Apps - deep dive
Progressive Web Apps - deep dive
 
New trends on web platform
New trends on web platformNew trends on web platform
New trends on web platform
 
Web Assembly (W3C TPAC presentation)
Web Assembly (W3C TPAC presentation)Web Assembly (W3C TPAC presentation)
Web Assembly (W3C TPAC presentation)
 
Generic sensors for the Web
Generic sensors for the WebGeneric sensors for the Web
Generic sensors for the Web
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Cold front - bridging the web and the physical world
Cold front - bridging the web and the physical worldCold front - bridging the web and the physical world
Cold front - bridging the web and the physical world
 
Web components v1 intro
Web components v1 introWeb components v1 intro
Web components v1 intro
 
WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)
 
WebKit, why it matters?
WebKit, why it matters?WebKit, why it matters?
WebKit, why it matters?
 
Qt WebKit going Mobile
Qt WebKit going MobileQt WebKit going Mobile
Qt WebKit going Mobile
 
Connecting Technology for Great Experiences - How does QML and Web fit together?
Connecting Technology for Great Experiences - How does QML and Web fit together?Connecting Technology for Great Experiences - How does QML and Web fit together?
Connecting Technology for Great Experiences - How does QML and Web fit together?
 

Último

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Último (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Considering Tiling for a better User Interface

  • 1. Considering Tiling for a better User Experience Kenneth Rohde Christiansen WebKit Code Camp, Wiesbaden, December 2009
  • 2. SOMETHING THAT I HAVE BEEN WORKING ON
  • 3. SOMETHING THAT I HAVE BEEN WORKING ON WHO AM I?
  • 4. SOMETHING THAT I HAVE BEEN WORKING ON WHO AM I? KENNETH R. CHRISTIANSEN
  • 5. SOMETHING THAT I HAVE BEEN WORKING ON WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER
  • 6. SOMETHING THAT I HAVE BEEN WORKING ON WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER 1+ YEAR WORKING WITH WEBKIT
  • 7. SOMETHING THAT I HAVE BEEN WORKING ON WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER 1+ YEAR WORKING WITH WEBKIT 3+ YEARS WORKING WITH APP & FRAMEWORK DEVELOPMENT AT
  • 8. SOMETHING THAT I HAVE BEEN WORKING ON WHO AM I? KENNETH R. CHRISTIANSEN WEBKIT REVIEWER 1+ YEAR WORKING WITH WEBKIT 3+ YEARS WORKING WITH APP & FRAMEWORK DEVELOPMENT AT NOKIA TECHNOLOGY INSTITUTE, INdT, RECIFE, BRAZIL
  • 10. What are the problems we are facing today? The background for considering tiling
  • 11. What are the problems we are facing today? The background for considering tiling WE PAINT THINGS WE’VE ALREADY PAINTED WHEN SCROLLING BACK
  • 12. What are the problems we are facing today? The background for considering tiling WE CALL INTO WEBCORE FOR EACH WE PAINT THINGS WE’VE PAINT... ALREADY PAINTED WHEN SCROLLING BACK
  • 13. What are the problems we are facing today? The background for considering tiling WE CALL INTO WEBCORE FOR EACH WE PAINT THINGS WE’VE PAINT... ALREADY PAINTED WHEN SCROLLING BACK ...CALLING INTO WEBCORE HAS SOME OVERHEAD
  • 14. What are the problems we are facing today? The background for considering tiling WE CALL INTO WEBCORE FOR EACH WE PAINT THINGS WE’VE PAINT... ALREADY PAINTED WHEN SCROLLING BACK FOR INSTANCE, CONSTRUCTING GRAPHICS CONTEXT IS QUITE EXPENSIVE ...CALLING INTO WEBCORE HAS SOME OVERHEAD
  • 15. What are the problems we are facing today? The background for considering tiling WE CALL INTO WEBCORE FOR EACH WE PAINT THINGS WE’VE PAINT... ALREADY PAINTED WHEN SCROLLING BACK FOR INSTANCE, CONSTRUCTING GRAPHICS CONTEXT IS QUITE EXPENSIVE ...CALLING INTO WEBCORE HAS SOME OVERHEAD CLEVER TILING CAN SOLVE THESE ISSUES
  • 16. How to accomplish this What is tiling anyway? Cache and join paint events
  • 17. How to accomplish this What is tiling anyway? Cache and join paint events Cache what you paint in image tiles
  • 18. How to accomplish this What is tiling anyway? Cache and join paint events Cache what you paint in image tiles Blit the existing tiles on scroll
  • 19. How to accomplish this What is tiling anyway? Cache and join paint events Cache what you paint in image tiles Blit the existing tiles on scroll Don’t paint non-visible dirty areas immediately
  • 20. How to accomplish this What is tiling anyway? Cache and join paint events Cache what you paint in image tiles Blit the existing tiles on scroll Don’t paint non-visible dirty areas immediately Avoid too many small tiles, due to the cost of constructing GraphicsContexts
  • 21. How to accomplish this What is tiling anyway? Cache and join paint events Cache what you paint in image tiles Blit the existing tiles on scroll Don’t paint non-visible dirty areas immediately Avoid too many small tiles, due to the cost of constructing GraphicsContexts This can be hardware accelerated!
  • 22. My experiment My basic algorithm As an experiment, implement it on the WebKit side
  • 23. My experiment My basic algorithm As an experiment, implement it on the WebKit side Implemented only for QGraphicsWebView
  • 24. My experiment My basic algorithm As an experiment, implement it on the WebKit side Implemented only for QGraphicsWebView Some changes needed elsewhere: 1) Render methods in abs. coordinates, without clipping
  • 25. My experiment My basic algorithm As an experiment, implement it on the WebKit side Implemented only for QGraphicsWebView Some changes needed elsewhere: 1) Render methods in abs. coordinates, without clipping 2) Make ScrollView / FrameView send update events outside of the viewport
  • 26. My experiment My basic algorithm As an experiment, implement it on the WebKit side Implemented only for QGraphicsWebView Some changes needed elsewhere: 1) Render methods in abs. coordinates, without clipping 2) Make ScrollView / FrameView send update events outside of the viewport Why not just make viewport == contents size?
  • 27. My experiment My basic algorithm As an experiment, implement it on the WebKit side Implemented only for QGraphicsWebView Some changes needed elsewhere: 1) Render methods in abs. coordinates, without clipping 2) Make ScrollView / FrameView send update events outside of the viewport Why not just make viewport == contents size? Because we use WebCore for drawing our scrollbars and that makes a whole lot of sense ... theming ... etc
  • 28. My experiment My basic algorithm Basic algorithm
  • 29. My experiment My basic algorithm Basic algorithm If not in cache, paint the dirty area as a tile, enlarge it slightly (64 pixels in each direction)
  • 30. My experiment My basic algorithm Basic algorithm If not in cache, paint the dirty area as a tile, enlarge it slightly (64 pixels in each direction) Put in cache, blit to screen
  • 31. My experiment My basic algorithm Basic algorithm If not in cache, paint the dirty area as a tile, enlarge it slightly (64 pixels in each direction) Put in cache, blit to screen Each tile stores it’s covered area as well as a dirty area.
  • 32. My experiment My basic algorithm Basic algorithm If not in cache, paint the dirty area as a tile, enlarge it slightly (64 pixels in each direction) Put in cache, blit to screen Each tile stores it’s covered area as well as a dirty area. On update, we update the dirty area of the intersected tiles. If it has such an area already, the bounding rect is uses as the new area. Remember, we try to avoid calling into WebCore unnecessarily
  • 33. My experiment My basic algorithm Basic algorithm If not in cache, paint the dirty area as a tile, enlarge it slightly (64 pixels in each direction) Put in cache, blit to screen Each tile stores it’s covered area as well as a dirty area. On update, we update the dirty area of the intersected tiles. If it has such an area already, the bounding rect is uses as the new area. Remember, we try to avoid calling into WebCore unnecessarily Furthermore, if the dirty area == covered area, remove it from cache
  • 34. My experiment My basic algorithm Basic algorithm
  • 35. My experiment My basic algorithm Basic algorithm On update and scroll: Update all tiles, blit what is in the cache, create tiles for what is not
  • 36. My experiment My basic algorithm Basic algorithm On update and scroll: Update all tiles, blit what is in the cache, create tiles for what is not That is more of less the basic algorithm, but there are some problems.
  • 37. My experiment My basic algorithm Problems
  • 38. My experiment My basic algorithm Problems Scrollbars Paint the scrollbars separately, make sure updates to them do not invalidate any tiles. These are not tiled in my implementation!
  • 39. My experiment My basic algorithm Problems Scrollbars Paint the scrollbars separately, make sure updates to them do not invalidate any tiles. These are not tiled in my implementation! Enlarging tiles When enlarging we much make sure that we don’t cover an area already in the cache, so I need to know what area is cached.
  • 40. My experiment My basic algorithm Problems
  • 41. My experiment My basic algorithm Problems Cache growth Storing the whole page in the cache would be expensive, memory-wise, so the cache has a max size.
  • 42. My experiment My basic algorithm Problems Cache growth Storing the whole page in the cache would be expensive, memory-wise, so the cache has a max size. The solution is to give each tile an age and increase the age when not used, and reset it when being blit.
  • 43. My experiment My basic algorithm Problems Cache growth Storing the whole page in the cache would be expensive, memory-wise, so the cache has a max size. The solution is to give each tile an age and increase the age when not used, and reset it when being blit. Before adding a new tile, we reserve the needed space for it, removing the oldest tiles.
  • 44. So what is the preliminary results? Did it really pay off? Benjamin wrote a simple scrolling test app, and the results are quite promising.
  • 45. So what is the preliminary results? Did it really pay off? Benjamin wrote a simple scrolling test app, and the results are quite promising. QWEBVIEW PERFORMS RESONABLE, DUE TO THE XCOPYREGION
  • 46. So what is the preliminary results? Did it really pay off? Benjamin wrote a simple scrolling test app, and the results are quite promising. QWEBVIEW PERFORMS THE TILING IS FASTER! RESONABLE, DUE TO THE XCOPYREGION
  • 47. So what is the preliminary results? Did it really pay off? Benjamin wrote a simple scrolling test app, and the results are quite promising. QWEBVIEW PERFORMS THE TILING IS FASTER! RESONABLE, DUE TO THE XCOPYREGION But we had some surprises as well. NON-TILED QGRAPHICSWEBVIEW IS EXTREMELY SLOW
  • 48. Where are se’ numbers? Back up your claims dude! Simple painting QWebView QGraphicsWebView Tiled QGraphicsWebView 0 2,5 5,0 7,5 10,0 Milliseconds
  • 49. Where are se’ numbers? Back up your claims dude! Slashdot page QWebView QGraphicsWebView Tiled QGraphicsWebView 0 25 50 75 100 Milliseconds
  • 50. Where are se’ numbers? Back up your claims dude! Amazon book page QWebView QGraphicsWebView Tiled QGraphicsWebView 0 22,5 45,0 67,5 90,0 Milliseconds
  • 51. Where are se’ numbers? Back up your claims dude! Wikipedia Qt page QWebView QGraphicsWebView Tiled QGraphicsWebView 0 37,5 75,0 112,5 150,0 Milliseconds
  • 52. Can’t you do better than that? Ideas for improvement WE CAN!
  • 53. Can’t you do better than that? Ideas for improvement WE CAN! More realistic test suite!
  • 54. Can’t you do better than that? Ideas for improvement WE CAN! More realistic test suite! My data structures are not that good, nor profiled
  • 55. Can’t you do better than that? Ideas for improvement WE CAN! More realistic test suite! My data structures are not that good, nor profiled Should be lower in the stack using WebCore constructs
  • 56. Can’t you do better than that? Ideas for improvement WE CAN! More realistic test suite! My data structures are not that good, nor profiled Should be lower in the stack using WebCore constructs Paint in another thread, not block WebCore
  • 57. Can’t you do better than that? Ideas for improvement WE CAN! More realistic test suite! My data structures are not that good, nor profiled Should be lower in the stack using WebCore constructs Paint in another thread, not block WebCore That is why we are here ;-) Now let’s get on to the work!
  • 58. Thanks for listening KENNETH ROHDE CHRISTIANSEN ext-kenneth.christiansen@nokia.com kenneth.christiansen@openbossa.org