[Webkit-unassigned] [Bug 63531] Turn PreloadScanner implementation to a thread based solution

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 28 11:22:19 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=63531





--- Comment #4 from Tony Gentilcore <tonyg at chromium.org>  2011-06-28 11:22:18 PST ---
> Is this just offloading the CPU time spent parsing or does it actually allow us to discover subresources earlier?

BTW, I ask because there are different ways this could evolve. If the concern is the CPU we spend running the preload scanner, an alternative to consider is reusing the tokens the scanner generates instead of discarding them (https://bugs.webkit.org/show_bug.cgi?id=57376).

The theory behind the preload scanner is that the parsing CPU time is trivial compared to the time spent waiting for subresources to download. So we spend extra CPU in order to start subresource downloads as early as possible so they can download while we are blocked on other things.

So the real optimization target is running the scanner as early as possible. One way we can get gaps in the download waterfall today is that the UI thread is busy for a while while the scanner is running. For instance:

<script>
  workForOneSecond();
</script>
<img src=foo.gif>

In that case we'd parse sequentially and execute the script without ever running the preload scanner. So foo.gif was not discovered as early as possible. A potential solution would be to always run the preload scanner first thing in insert()/append(), then pass the tokens to the real parser for it to actually run the scripts and build the tree. Obviously we'd only want to do that if we could reuse tokens and there'd probably be some limit in how far we'd let it run before doing real parsing.

Anyway, just throwing this out for your consideration.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list