SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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.
 

Mehr von 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?
 

Kürzlich hochgeladen

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
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
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
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
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
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
 
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
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
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
 

Kürzlich hochgeladen (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
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...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
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
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
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
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
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#
 
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...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
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
 

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