From e56975691186fba63a20fa73dc0b8d245c86ca07 Mon Sep 17 00:00:00 2001 From: "hong.zheng@intel.com" Date: Fri, 25 Apr 2014 08:55:49 +0000 Subject: Cache total_delayable_count for in_flight_requests in ResourceScheduler In ResourceScheduler::GetNumDelayableRequestsInFlight, total_delayable_count has no relation to active_request_host, so we do not need to compute it for each request. The patch can boost BrowsingBench workload >5% performance. BUG=347454 Review URL: https://codereview.chromium.org/180843016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266165 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/loader/resource_scheduler.h | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'content/browser/loader/resource_scheduler.h') diff --git a/content/browser/loader/resource_scheduler.h b/content/browser/loader/resource_scheduler.h index cd8f054..0e918f1 100644 --- a/content/browser/loader/resource_scheduler.h +++ b/content/browser/loader/resource_scheduler.h @@ -92,7 +92,7 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { bool operator()(const ScheduledResourceRequest* a, const ScheduledResourceRequest* b) const; }; - struct Client; + class Client; typedef int64 ClientId; typedef std::map ClientMap; @@ -101,9 +101,6 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { // Called when a ScheduledResourceRequest is destroyed. void RemoveRequest(ScheduledResourceRequest* request); - // Unthrottles the |request| and adds it to |client|. - void StartRequest(ScheduledResourceRequest* request, Client* client); - // Update the queue position for |request|, possibly causing it to start // loading. // @@ -114,29 +111,6 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { net::RequestPriority new_priority, int intra_priority_value); - // Attempts to load any pending requests in |client|, based on the - // results of ShouldStartRequest(). - void LoadAnyStartablePendingRequests(Client* client); - - // Returns the number of requests with priority < LOW that are currently in - // flight. - void GetNumDelayableRequestsInFlight( - Client* client, - const net::HostPortPair& active_request_host, - size_t* total_delayable, - size_t* total_for_active_host) const; - - enum ShouldStartReqResult { - DO_NOT_START_REQUEST_AND_STOP_SEARCHING = -2, - DO_NOT_START_REQUEST_AND_KEEP_SEARCHING = -1, - START_REQUEST = 1, - }; - - // Returns true if the request should start. This is the core scheduling - // algorithm. - ShouldStartReqResult ShouldStartRequest(ScheduledResourceRequest* request, - Client* client) const; - // Returns the client ID for the given |child_id| and |route_id| combo. ClientId MakeClientId(int child_id, int route_id); -- cgit v1.1