SlideShare uma empresa Scribd logo
1 de 58
Baixar para ler offline
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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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.
 

Mais 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

Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Último (20)

Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

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