mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-07-31 01:36:15 -04:00
Builds on top of the recently added support for <link rel=preload...> and <link rel=modulePreload...> to scan the HTML for script tags to preload. I.e. adds script preloading without actually having any preload hits. At least for this first pass, I opted for a simple approach which leverages are fully buffered HTML body and html5ever's tokenizer to prescan the body and kickoff any script fetching before starting the complete parse. There are doubtless cases where this will either decrease performance and/or increase memory usage. E.g. a site with no script gets its html scanned twice and loading multiple blocking scripts in parallel obvious uses more memory than loading them sequentially. But for most sites and I think most use-cases, the impact should range between neutral to significantly faster loads. This is something most browsers do.