[webkit-changes] [WebKit/WebKit] bbe1fd: Fix performance regression after 271209 at main

Alex Christensen noreply at github.com
Mon Dec 4 19:46:18 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bbe1fd08c84508af0e8824856b928da3f641879e
      https://github.com/WebKit/WebKit/commit/bbe1fd08c84508af0e8824856b928da3f641879e
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp

  Log Message:
  -----------
  Fix performance regression after 271209 at main
https://bugs.webkit.org/show_bug.cgi?id=265826
rdar://118948980

Reviewed by Per Arne Vollan.

271209 at main introduced a CompletionHandler to SpeculativeLoad::willSendRedirectedRequest.
Before that change, we would just destroy the NetworkLoad and be done.
After that change, we call the redirect completion handler with an empty ResourceRequest
before destroying the NetworkLoad, which calls updateRequest and didCompleteWithError.
This PR changes calling the completion handler to after the call to SpeculativeLoad::didComplete
which destroys the NetworkLoad.  That way, the lambda at the end of the function
NetworkLoad::willPerformHTTPRedirection just finds a null weakThis and does none of this
unnecessary work.  I verified that this is what is going on on the sites in the radar
that showed a performance regression, and I verified that this change removes that unnecessary
work when not following redirects.

* Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):

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




More information about the webkit-changes mailing list