Commit Graph
1163 Commits
Author SHA1 Message Date
Valentin Gosu 44bd5382c0 Bug 2006028 - Remove predictor code r=necko-reviewers,firefox-style-system-reviewers,emilio,kershaw,extension-reviewers,toolkit-telemetry-reviewers,manuel,robwu
The network predictor used the HTTP cache as a database to learn browsing
patterns and make speculative DNS prefetches, TCP preconnects, and resource
prefetches. While this provided performance benefits for repeat visits to
frequently-accessed sites, it came with significant costs: I/O on every page
load, CPU overhead for prediction algorithms, memory for caching learned
patterns, and substantial IPC complexity with six message types coordinating
predictions between processes.

A large part of the functionality the predictor was meant to improve is now
available to webdevelopers. HTTP 103 Early Hints allow servers to explicitly
specify resources to preload while generating the response.
And Speculation Rules API will enable content authors to declaratively specify
prefetch/prerender behavior based on their knowledge of site structure and user
intent, providing immediate accuracy without a learning period.

The network.predictor.enable-hover-on-ssl preference is retained as it controls
simpler hover-triggered speculative connections that don't require the
predictor's learning system. This removal simplifies the codebase while
steering users toward more accurate, standards-based optimization mechanisms.

The one feature of the predictor which was never used was learning websites
that are opened soon after startup. There was no action taken based on this
info, and we could already predict this info based on the history database.

Differential Revision: https://phabricator.services.mozilla.com/D276437
2025-12-18 22:56:37 +00:00
Tooru Fujisawa e17241ae51 Bug 2006042 - Show script instantiation in the profiler, separately than compile/decode. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D276578
2025-12-17 21:04:07 +00:00
Tooru Fujisawa fb321bdf9c Bug 2004064 - Yield to other tasks before processing long defer scripts if no FCP have happened. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D275741
2025-12-17 21:04:04 +00:00
Atila Butkovits 79e1b89109 Revert "Bug 2006028 - Remove predictor code r=necko-reviewers,firefox-style-system-reviewers,emilio,kershaw" for causing failures at test_basic.js.
This reverts commit 117ed7db99.
2025-12-16 09:52:23 +00:00
Valentin Gosu 117ed7db99 Bug 2006028 - Remove predictor code r=necko-reviewers,firefox-style-system-reviewers,emilio,kershaw
The network predictor used the HTTP cache as a database to learn browsing
patterns and make speculative DNS prefetches, TCP preconnects, and resource
prefetches. While this provided performance benefits for repeat visits to
frequently-accessed sites, it came with significant costs: I/O on every page
load, CPU overhead for prediction algorithms, memory for caching learned
patterns, and substantial IPC complexity with six message types coordinating
predictions between processes.

A large part of the functionality the predictor was meant to improve is now
available to webdevelopers. HTTP 103 Early Hints allow servers to explicitly
specify resources to preload while generating the response.
And Speculation Rules API will enable content authors to declaratively specify
prefetch/prerender behavior based on their knowledge of site structure and user
intent, providing immediate accuracy without a learning period.

The network.predictor.enable-hover-on-ssl preference is retained as it controls
simpler hover-triggered speculative connections that don't require the
predictor's learning system. This removal simplifies the codebase while
steering users toward more accurate, standards-based optimization mechanisms.

The one feature of the predictor which was never used was learning websites
that are opened soon after startup. There was no action taken based on this
info, and we could already predict this info based on the history database.

Differential Revision: https://phabricator.services.mozilla.com/D276437
2025-12-16 08:58:03 +00:00
Daniel Minor 26107c4f63 Bug 1994828 - Don't cache wasm modules; r=arai
Differential Revision: https://phabricator.services.mozilla.com/D275506
2025-12-12 14:15:10 +00:00
Daniel Minor 67234fcc68 Bug 1994828 - Set wasm mime type on module request; r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D270151
2025-12-12 14:15:04 +00:00
Daniel Minor 29510a2971 Bug 1994828 - Add checks for wasm mime type for script loading; r=dom-core,necko-reviewers,smaug,sunil
Differential Revision: https://phabricator.services.mozilla.com/D270149
2025-12-12 14:14:58 +00:00
Tooru Fujisawa 617d3747f1 Bug 2002960 - Part 3: Use nsICacheEntryWriteHandle in LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274398
2025-12-10 10:29:23 +00:00
Tooru Fujisawa bad9fe1be6 Bug 2002960 - Part 2: Tweak the branches in ScriptLoader::OnStreamComplete to avoid unnecessary operations. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274747
2025-12-10 10:29:20 +00:00
Tooru Fujisawa 5f619a0163 Bug 2002960 - Part 1: Eagerly reflect the necko fetch count to LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274746
2025-12-10 10:29:17 +00:00
agoloman a92ad13839 Revert "Bug 2002960, Bug 2002954 - Part 3: Use nsICacheEntryWriteHandle in LoadedScript. r=nbp" for causing build bustages @nsHttpChannel.cpp.
This reverts commit 1efe30299a.

Revert "Bug 2002960 - Part 2: Tweak the branches in ScriptLoader::OnStreamComplete to avoid unnecessary operations. r=nbp"

This reverts commit e967997339.

Revert "Bug 2002960 - Part 1: Eagerly reflect the necko fetch count to LoadedScript. r=nbp"

This reverts commit b096c129a4.

Revert "Bug 2002954 - Add nsICacheEntryWriteHandle and PCacheEntryWriteHandle to expose the nsICacheEntry::openAlternativeOutputStream to content process. r=valentin,necko-reviewers"

This reverts commit ca6e20dc42.
2025-12-09 08:05:11 +00:00
Tooru Fujisawa 1efe30299a Bug 2002960 - Part 3: Use nsICacheEntryWriteHandle in LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274398
2025-12-09 07:22:17 +00:00
Tooru Fujisawa e967997339 Bug 2002960 - Part 2: Tweak the branches in ScriptLoader::OnStreamComplete to avoid unnecessary operations. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274747
2025-12-09 07:22:14 +00:00
Tooru Fujisawa b096c129a4 Bug 2002960 - Part 1: Eagerly reflect the necko fetch count to LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274746
2025-12-09 07:22:12 +00:00
Tooru Fujisawa 2613218569 Bug 2002199 - Part 4: Remove LoadedScriptDelegate::ClearScriptSource. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D273971
2025-12-02 01:28:17 +00:00
Tooru Fujisawa 2cb4e84b91 Bug 2002199 - Part 3: Remove LoadedScriptDelegate::ConvertToCachedStencil. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D273970
2025-12-02 01:28:15 +00:00
Tooru Fujisawa 25350f05ab Bug 2002199 - Part 2: Remove {LoadedScript,LoadedScriptDelegate}::IsSource. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D273969
2025-12-02 01:28:12 +00:00
Tooru Fujisawa fb06302042 Bug 1907011 - Part 7: Update the most of the remaining usage of "bytecode" and update document. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273960
2025-11-26 04:13:26 +00:00
Tooru Fujisawa 2520b3066a Bug 1907011 - Part 4: Rename LoadedScript::Bytecode to LoadedScript::SerializedStencil. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273957
2025-11-26 04:13:18 +00:00
Tooru Fujisawa da2d987339 Bug 1907011 - Part 3: Rename LoadedScript::DropBytecode to LoadedScript::DropSRIOrSRIAndSerializedStencil. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273956
2025-11-26 04:13:15 +00:00
Tooru Fujisawa dee0f66355 Bug 1907011 - Part 2: Split LoadedScript::SRIAndBytecode into LoadedScript::SRI and LoadedScript::SRIAndSerializedStencil for each cosnumer. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273955
2025-11-26 04:13:12 +00:00
Tooru Fujisawa 58730279e1 Bug 1907011 - Part 1: Rename bytecode to serialized stencil in LoadedScript DataType. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273954
2025-11-26 04:13:10 +00:00
Tooru Fujisawa 15bece78c5 Bug 1999649 - Part 1: Reflect ReferrerPolicy to the ScriptHashKey. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D272504
2025-11-19 03:49:47 +00:00
Tooru Fujisawa ae2826ed85 Bug 1998925 - Part 1: Add dirty flag to LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D271875
2025-11-19 03:47:14 +00:00
Tooru Fujisawa 707e3dbad3 Bug 1997870 - Part 3: Split EncodeBytecodeAndSave into two steps. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271034
2025-11-11 08:28:34 +00:00
Tooru Fujisawa 235f7f63b3 Bug 1997870 - Part 2: Make BytecodeMimeTypeFor methods take const. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271033
2025-11-11 08:28:32 +00:00
Tooru Fujisawa 2041d040bb Bug 1997870 - Part 1: Remove obsolete comment. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271032
2025-11-11 08:28:29 +00:00
Cristian Tuns adb38904a5 Revert "Bug 1997870 - Part 4: Perform the encoding and the compression off main thread. r=bthrall" for causing build bustages in SharedScriptCache.cpp
This reverts commit c6b62c4029.

Revert "Bug 1997870 - Part 3: Split EncodeBytecodeAndSave into two steps. r=bthrall"

This reverts commit f6fed9057d.

Revert "Bug 1997870 - Part 2: Make BytecodeMimeTypeFor methods take const. r=bthrall"

This reverts commit 751adfcc4b.

Revert "Bug 1997870 - Part 1: Remove obsolete comment. r=bthrall"

This reverts commit cc15fbf365.
2025-11-10 12:12:57 +00:00
Tooru Fujisawa f6fed9057d Bug 1997870 - Part 3: Split EncodeBytecodeAndSave into two steps. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271034
2025-11-10 11:32:36 +00:00
Tooru Fujisawa 751adfcc4b Bug 1997870 - Part 2: Make BytecodeMimeTypeFor methods take const. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271033
2025-11-10 11:32:33 +00:00
Tooru Fujisawa cc15fbf365 Bug 1997870 - Part 1: Remove obsolete comment. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271032
2025-11-10 11:32:31 +00:00
Daniel Minor 6063b19321 Bug 1997638 - Check mimetype essence for CSS modules; r=dom-core,smaug
In the initial implementation, I mistakenly checked the mime type, but section
13.7.3 of https://html.spec.whatwg.org/#fetch-a-single-module-script says
this should be the mime type essence.

Differential Revision: https://phabricator.services.mozilla.com/D271091
2025-11-05 15:16:12 +00:00
Tooru Fujisawa 4a904c5804 Bug 1973221 - Part 1: Support disk cache for dynamic import. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D271030
2025-11-05 04:12:21 +00:00
Tooru Fujisawa 3f51581da2 Bug 1853173 - Part 5: Add notification for corrupted SRI. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D271026
2025-11-05 04:12:10 +00:00
Cornelius Emase ebfd828841 Bug 1996859 - Handle 'bytes' module type in DOM loaders. r=dminor,dom-core,smaug
Add support for JS::ModuleType::Bytes in Worker and Worklet loaders.
Duplicate Unknown handling and restrict IsModuleTypeAllowed to JS and
JSON modules only.

Differential Revision: https://phabricator.services.mozilla.com/D270803
2025-11-03 17:16:37 +00:00
Tooru Fujisawa f70e74238b Bug 1980154 - Part 4: Use SharedScriptCache for disk cache handling when navigation cache is enabled. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270524
2025-10-31 05:24:30 +00:00
Tooru Fujisawa 905ed24b39 Bug 1980154 - Part 2: Factor out the disk cache strategy into ScriptLoader::GetDiskCacheStrategy. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270522
2025-10-31 05:24:25 +00:00
Tooru Fujisawa 3853c05fdf Bug 1980154 - Part 1: Make EncodeBytecodeAndSave a static function. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270521
2025-10-31 05:24:23 +00:00
Tooru Fujisawa 6423ed49a9 Bug 1880453 - Part 2: Add testcase for in-memory cache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270114
2025-10-29 23:32:23 +00:00
Tooru Fujisawa 84bbb8137b Bug 1996230 - Reflect necko cache fetch count to in-memory cache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270112
2025-10-29 23:32:18 +00:00
Tooru Fujisawa 83f856f1dd Bug 1996160 - Part 2: Revive tracing for bytecode encoding. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270111
2025-10-29 23:32:15 +00:00
Tooru Fujisawa b1c9db5a25 Bug 1996160 - Part 1: Use observer notifications for ScriptLoader tests. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270110
2025-10-29 23:32:13 +00:00
Tooru Fujisawa 38ff092450 Bug 1995985 - Add assertion to avoid using request expiration time for cached case. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270109
2025-10-29 14:33:10 +00:00
Tooru Fujisawa 1ef85f97ca Bug 1995994 - Do not check already-collecting-delazifications condition and let the disk cache logic to filter out properly. r=nbp
Given that the in-memory cache doesn't need any followup task, and also
the disk cache should reflect the latest fetch's condition for the fetch count
etc, we don't have to check the already-collecting-delazifications condition
on instantiation.

For example, if the previous fetch doesn't meet the minimum fetch count but
the current meet, the disk cache should be performed with the current fetch's
input.

Differential Revision: https://phabricator.services.mozilla.com/D270108
2025-10-29 14:33:07 +00:00
Tooru Fujisawa cf0ac52917 Bug 1995983 - Put bytecode response to in-memory cache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270107
2025-10-29 14:33:05 +00:00
Tooru Fujisawa 26d940e00c Bug 1994617 - Part 6: Check the expired request early. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270106
2025-10-29 09:39:56 +00:00
Tooru Fujisawa 1bdbf595f9 Bug 1994617 - Part 5: Reorder CalculateCacheFlag items. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270105
2025-10-29 09:39:53 +00:00
Tooru Fujisawa 37cf677d05 Bug 1994617 - Part 4: Use CachingPlan::NotCacheable for non-http/https. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270104
2025-10-29 09:39:51 +00:00
Tooru Fujisawa fa8a3601f3 Bug 1994617 - Part 3: Use CachingPlan::NotCacheable for inline scripts. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270103
2025-10-29 09:39:48 +00:00