<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - NetworkProcess: DNS prefetch happens in the Web Process"
   href="https://bugs.webkit.org/show_bug.cgi?id=147824#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - NetworkProcess: DNS prefetch happens in the Web Process"
   href="https://bugs.webkit.org/show_bug.cgi?id=147824">bug 147824</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=147824#c15">comment #15</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=262440&amp;action=diff" name="attach_262440" title="Updated patch">attachment 262440</a> <a href="attachment.cgi?id=262440&amp;action=edit" title="Updated patch">[details]</a></span>
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=262440&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=262440&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebKit2/NetworkProcess/NetworkProcess.h:197
&gt; &gt; +    HashSet&lt;String&gt; m_dnsPrefetchedHosts;
&gt; 
&gt; This HashSet grows indefinitely, and NetworkProcess can exist for weeks or
&gt; even for months.</span >

I thought about it, my initial idea was to cache only in the web process, since the real performance problem is likely when the same web process requests the same hosts a lot of times, rather than different web processes requesting the same host. So we could simplify it by only caching in the web process and assuming that we might end up requesting the same host by two different web processes.

<span class="quote">&gt; &gt; Source/WebKit2/WebProcess/WebProcess.h:368
&gt; &gt; +    HashSet&lt;String&gt; m_dnsPrefetchedHosts;
&gt; 
&gt; Is it OK to keep hosts here for a long time? I think that this may entirely
&gt; disable the optimization of prefetching link hosts on hover - the hosts were
&gt; already prefetched when loading, but the OS resolver may have well
&gt; invalidated the cache already.</span >

Good point. Maybe we should only ensure we don't ask the same hosts in a short period of time, instead. For example when hovering, we start a lot of requests for the same link when the mouse is moving.

<span class="quote">&gt; DNS prefetching is a really weird thing. We don't have any way to measure
&gt; its effectiveness, which is not how we usually go about performance
&gt; optimizations.</span >

Yeah, indeed.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>