-
Notifications
You must be signed in to change notification settings - Fork 14
Configurable resource prefetching #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
--no-prefetch will directly use `load(...)` instead of just injecting the script sources which makes it easier to navigate and investigate profiles. - Support more complex command line args and flags - Add --help to cli.js Bug: 411303884 Change-Id: I43a032342a6da42bfb61ebd9415e62f9d9597ecc Reviewed-on: https://chromium-review.googlesource.com/c/external/github.com/WebKit/JetStream/+/6468518 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Marja Hölttä <marja@chromium.org>
✅ Deploy Preview for webkit-jetstream-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems fine. A couple comments though.
for (const test of testPlans) | ||
print(" ", test.name) | ||
} else { | ||
print("Running tests: " + testList) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not print this? I often run the cli with jsc -e 'dumpJSONResults = true' cli.js > results.json
and this print would break that.
if (globalThis.prefetchResources) | ||
addScriptWithURL(cache[file].blobURL); | ||
else | ||
addScriptWithURL(file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would just make this addScriptWithURL(globalThis.prefetchResources ? cache[file].blobURL : file);
@@ -23,25 +23,47 @@ | |||
* THE POSSIBILITY OF SUCH DAMAGE. | |||
*/ | |||
|
|||
globalThis.prefetchResources = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unneeded.
@@ -36,7 +36,9 @@ | |||
const isInBrowser = true; | |||
const isD8 = false; | |||
const isSpiderMonkey = false; | |||
globalThis.prefetchResources = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto on unneeded.
@@ -62,8 +70,12 @@ if (typeof(URLSearchParams) !== "undefined") { | |||
customTestList = urlParameters.getAll("test"); | |||
globalThis.testIterationCount = getIntParam(urlParameters, "iterationCount"); | |||
globalThis.testWorstCaseCount = getIntParam(urlParameters, "worstCaseCount"); | |||
globalThis.prefetchResources = getBoolParam(urlParameters, "prefetchResources", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pass globalThis.prefetchResources
as the default value rather than true. Seems less likely to cause unexpected behavior if someone manually edits a different part of the script.
This addresses issue #58 and is useful for local profiling.
If the prefetchResources is disabled, we now no longer preload them eagerly, but rather use the live URL and either script-inject it or use it directly with workers.
This means we can easily get the original source positions for profiling.
--no-prefetch
command ilne support&prefetchResources=0
URLParam supportDrive-by-fix: