diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 22:30:49 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 22:30:49 +0000 |
commit | 501e2d4ea3c5d685fec8b34618a79964fe2945a7 (patch) | |
tree | a6c1251f903369a770f1adcaf99ebec972cb7b5c /net/proxy/sync_host_resolver_bridge.h | |
parent | 616b701515db7fea8e86cf01688b8840238ecdad (diff) | |
download | chromium_src-501e2d4ea3c5d685fec8b34618a79964fe2945a7.zip chromium_src-501e2d4ea3c5d685fec8b34618a79964fe2945a7.tar.gz chromium_src-501e2d4ea3c5d685fec8b34618a79964fe2945a7.tar.bz2 |
Improve performance of proxy resolver by tracing DNS dependencies.
This replaces the multi-threaded V8 proxy resolver implementation, with a faster single-threaded one. The single-threaded version uses some magic to avoid blocking on DNS dependencies, so it is able to handle more parallel requests than the multi-threaded one.
Design document: https://docs.google.com/a/chromium.org/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPoMJdaBn9rKreAmGOdE/edit
This has the benefit of reducing the number of threads that Chrome uses for PAC evaluation, while at the same time speeding up proxy resolving for PAC scripts that do DNS resolving (due to better parallelism).
I ran a benchmark to evaluate the effectiveness of this new approach. The benchmark simulates loading the http://www.newyorktimes.com webpage with slow DNS (where each DNS resolve takes 2 seconds), and a maximum DNS resolver parallelism of 10 requests. This webpage resolves the proxy for 221 URLs, across 40 unique hostnames.
- Proxy resolving using the old multithreaded code took 24.076 seconds [*]
- Proxy resolving using the new code took 8.011 seconds [*]
- Without a PAC script, resolving the DNS took 8.003 seconds
The new proxy resolving times (8.011s) are much closer to the theoretical best (8.003s)!
[*] The PAC script I used for the test was a fairly complex script 20kb (a version of google's corp PAC script modified to always call dnsResolve(host)).
I will be adding histograms in a follow-up CL, to measure how often requests need to be restarted, or fall-back to synchronous mode.
BUG=119151
Review URL: https://codereview.chromium.org/11885009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/sync_host_resolver_bridge.h')
-rw-r--r-- | net/proxy/sync_host_resolver_bridge.h | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/net/proxy/sync_host_resolver_bridge.h b/net/proxy/sync_host_resolver_bridge.h deleted file mode 100644 index 1de67b5..0000000 --- a/net/proxy/sync_host_resolver_bridge.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_ -#define NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_ - -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "net/proxy/sync_host_resolver.h" - -class MessageLoop; - -namespace net { - -// Wrapper around HostResolver to give a sync API while running the resolver -// in async mode on |host_resolver_loop|. -class NET_EXPORT_PRIVATE SyncHostResolverBridge : public SyncHostResolver { - public: - SyncHostResolverBridge(HostResolver* host_resolver, - MessageLoop* host_resolver_loop); - - virtual ~SyncHostResolverBridge(); - - // SyncHostResolver methods: - virtual int Resolve(const HostResolver::RequestInfo& info, - AddressList* addresses, - const BoundNetLog& net_log) OVERRIDE; - - // The Shutdown() method should be called prior to destruction, from - // |host_resolver_loop_|. It aborts any in progress synchronous resolves, to - // prevent deadlocks from happening. - virtual void Shutdown() OVERRIDE; - - private: - class Core; - - MessageLoop* const host_resolver_loop_; - scoped_refptr<Core> core_; - DISALLOW_COPY_AND_ASSIGN(SyncHostResolverBridge); -}; - -} // namespace net - -#endif // NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_ |