{"json_modified": "2014-06-24T05:49:19.928091", "slug": "Web/HTML/Optimizing_your_pages_for_speculative_parsing", "tags": [], "locale": "pt-BR", "title": "Optimizing your pages for speculative parsing", "translations": [{"locale": "en-US", "localization_tags": [], "last_edit": "2014-05-26T22:06:15", "url": "/en-US/docs/Web/HTML/Optimizing_your_pages_for_speculative_parsing", "title": "Optimizing your pages for speculative parsing"}, {"locale": "ru", "localization_tags": [], "last_edit": "2013-06-06T06:37:45", "url": "/ru/docs/HTML/Optimizing_Your_Pages_for_Speculative_Parsing", "title": "Optimizing your pages for speculative parsing"}, {"locale": "es", "localization_tags": ["inprogress"], "last_edit": "2014-06-01T17:32:21", "url": "/es/docs/Web/HTML/Optimizing_your_pages_for_speculative_parsing", "title": "Optimizing your pages for speculative parsing"}], "modified": "2014-06-24T05:49:19", "label": "Optimizing your pages for speculative parsing", "localization_tags": [], "url": "/pt-BR/docs/Web/HTML/Optimizing_your_pages_for_speculative_parsing", "last_edit": "2014-06-24T05:49:18", "summary": "Traditionally in browsers the HTML\u00a0parser has run on the main thread and has blocked after a </script> tag until the script has been retrieved from the network and executed. The HTML parser in Firefox 4 and later supports speculative parsing off the main thread. It parses ahead while scripts are being downloaded and executed. As in Firefox 3.5 and 3.6, the HTML parser starts speculative loads for scripts, style sheets and images it finds ahead in the stream. However, in Firefox 4 and later the HTML parser also runs the HTML tree construction algorithm speculatively. The upside is that when a speculation succeeds, there's no need to reparse the part of the incoming file that was already scanned for scripts, style sheets and images. The downside is that there's more work lost when the speculation fails.", "sections": [{"id": "Making_speculative_loads_succeed", "title": "Making speculative loads succeed"}, {"id": "Avoiding_losing_tree_builder_output", "title": "Avoiding losing tree builder output"}], "id": 59201, "review_tags": []}