-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add measurePrepare param #440
Draft
camillobruni
wants to merge
12
commits into
WebKit:main
Choose a base branch
from
camillobruni:2024-10-23_total_metric
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
582502f
fix
camillobruni ef55d6e
formatting
camillobruni 0824a91
cleanup and fix tests
camillobruni 0592058
formatting code
camillobruni 2146335
formatting
camillobruni 24b64a7
cleanup
camillobruni 3de83da
Merge branch '2024-11-04_params_update' into 2024-10-23_total_metric
camillobruni f3e893b
Merge branch '2024-11-04_dev_mode_cleanup' into 2024-10-23_total_metric
camillobruni f1683a5
Merge branch 'main' into 2024-10-23_total_metric
camillobruni be7e9f0
pre-format
camillobruni 6b352fd
fix code
camillobruni f2e2ce2
Merge branch 'main' of github.com:camillobruni/Speedometer into 2024-…
camillobruni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ export function createDeveloperModeContainer() { | |
settings.className = "settings"; | ||
settings.append(createUIForIterationCount()); | ||
settings.append(createUIForMeasurementMethod()); | ||
settings.append(createUIForDebugMetrics()); | ||
settings.append(createUIForWarmupSuite()); | ||
settings.append(createUIForWarmupBeforeSync()); | ||
settings.append(createUIForSyncStepDelay()); | ||
|
@@ -41,37 +42,41 @@ function span(text) { | |
} | ||
|
||
function createUIForMeasurementMethod() { | ||
let check = document.createElement("input"); | ||
check.type = "checkbox"; | ||
check.id = "measurement-method"; | ||
check.checked = params.measurementMethod === "raf"; | ||
|
||
check.onchange = () => { | ||
params.measurementMethod = check.checked ? "raf" : "timer"; | ||
const { checkbox, label } = createCheckboxUI("rAF timing", params.measurementMethod === "raf"); | ||
checkbox.onchange = () => { | ||
params.measurementMethod = checkbox.checked ? "raf" : "timer"; | ||
updateURL(); | ||
}; | ||
|
||
let label = document.createElement("label"); | ||
label.append(check, " ", span("rAF timing")); | ||
|
||
return label; | ||
} | ||
|
||
function createUIForWarmupSuite() { | ||
let check = document.createElement("input"); | ||
check.type = "checkbox"; | ||
check.id = "warmup-suite"; | ||
check.checked = !!params.useWarmupSuite; | ||
const { checkbox, label } = createCheckboxUI("Use Warmup Suite", params.useWarmupSuite); | ||
checkbox.onchange = () => { | ||
params.useWarmupSuite = checkbox.checked; | ||
updateURL(); | ||
}; | ||
return label; | ||
} | ||
|
||
check.onchange = () => { | ||
params.useWarmupSuite = check.checked; | ||
function createUIForDebugMetrics() { | ||
const { checkbox, label } = createCheckboxUI("Measure Debug Metrics", params.debugMetrics); | ||
checkbox.onchange = () => { | ||
params.debugMetrics = checkbox.checked; | ||
updateURL(); | ||
}; | ||
return label; | ||
} | ||
|
||
let label = document.createElement("label"); | ||
label.append(check, " ", span("Use Warmup Suite")); | ||
function createCheckboxUI(labelValue, initialValue) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could add the callback as a parameter and add it in this function. This would make the callers a lot leaner. Also it would be good to use an option parameter |
||
const checkbox = document.createElement("input"); | ||
checkbox.type = "checkbox"; | ||
checkbox.checked = !!initialValue; | ||
|
||
return label; | ||
const label = document.createElement("label"); | ||
label.append(checkbox, " ", span(labelValue)); | ||
|
||
return { checkbox, label }; | ||
} | ||
|
||
function createUIForIterationCount() { | ||
|
@@ -280,7 +285,7 @@ function updateURL() { | |
} | ||
} | ||
|
||
const defaultParamKeys = ["measurementMethod", "iterationCount", "useWarmupSuite", "warmupBeforeSync", "waitBeforeSync"]; | ||
const defaultParamKeys = ["measurementMethod", "iterationCount", "useWarmupSuite", "warmupBeforeSync", "waitBeforeSync", "debugMetrics"]; | ||
for (const paramKey of defaultParamKeys) { | ||
if (params[paramKey] !== defaultParams[paramKey]) | ||
url.searchParams.set(paramKey, params[paramKey]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 prefer to always record it, but never add it to
total
. And then I'm not sure we need the parameterdebugMetrics
anymore?