Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9f717e3bb0d15503330aad55b66c9d609594b1b9
      
https://github.com/WebKit/WebKit/commit/9f717e3bb0d15503330aad55b66c9d609594b1b9
  Author: Simon Fraser <[email protected]>
  Date:   2024-04-23 (Tue, 23 Apr 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm

  Log Message:
  -----------
  [UnifiedPDF] Resizing a slow-rendering PDF, wedges all cores for tens of 
minutes
https://bugs.webkit.org/show_bug.cgi?id=272880
rdar://126213078

Reviewed by Tim Horton.

Currently we dispatch PDF tile renders as soon as we get notified that a tile 
needs
new content. That causes all the requests to pile up in libdispatch, and once 
they
are dispatched we have no way to cancel those that are stale.

Fix by using a work queue for tile render requests; while requests are still in 
the
queue, they can be removed. We track how many renders are in flight, and only 
dispatch
new ones when requests complete.

The number of concurrent renders is computed based on the number of cores, with 
some
sensible limits. We don't just match the number of cores because that brings 
back the
original problem of farming out lots of uncancellable renders.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::maxConcurrentTileRenders):
(WebKit::AsyncPDFRenderer::AsyncPDFRenderer):
(WebKit::AsyncPDFRenderer::willRemoveTile):
(WebKit::AsyncPDFRenderer::clearRequestsAndCachedTiles):
(WebKit::AsyncPDFRenderer::enqueuePaintWithClip):
(WebKit::AsyncPDFRenderer::serviceRequestQueue):
(WebKit::AsyncPDFRenderer::didCompleteTileRender):

Canonical link: https://commits.webkit.org/277868@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to