-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VT: Add two blink_perf tests, and add blink_perf.view_transitions ben…
…chmark First test captures a very large element (the test takes about 1s on my linux machine) The second text, captures a lot of small elements (the test takes about 200ms on my linux machine) R=bokan@chromium.org, khushalsagar@chromium.org Bug: 1407677 Change-Id: I9d07de9911ac88ec8db059c4606d9d73dbaedfa9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4232959 Reviewed-by: John Chen <johnchen@chromium.org> Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102916}
- Loading branch information
Showing
5 changed files
with
115 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bokan@chromium.org | ||
khushalsagar@chromium.org | ||
vmpstr@chromium.org |
45 changes: 45 additions & 0 deletions
45
third_party/blink/perf_tests/view_transitions/huge_element_capture.html
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
html { view-transition-name: unset } | ||
#target { | ||
height: 100000px; | ||
width: 1000px; | ||
position: absolute; | ||
background: lightblue; | ||
contain: layout; | ||
view-transition-name: target; | ||
} | ||
.left { | ||
left: 8px; | ||
} | ||
.right { | ||
right: 8px; | ||
} | ||
::view-transition-group(*) { | ||
animation-duration: 0s; | ||
} | ||
</style> | ||
<script src="../resources/runner.js"></script> | ||
<script> | ||
function startTest() { | ||
var transition; | ||
PerfTestRunner.measureFrameTime({ | ||
description: "Measures performance starting/finishing a transition with a large element", | ||
setup: () => { | ||
transition = document.startViewTransition(() => { | ||
target.classList.toggle("left"); | ||
target.classList.toggle("right"); | ||
}); | ||
}, | ||
run: async () => { await transition.finished }, | ||
done: () => {} | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body onload="startTest()"> | ||
<div id=target class=left>This is a div!</div> | ||
<div id="log"></div> | ||
</body></html> |
52 changes: 52 additions & 0 deletions
52
third_party/blink/perf_tests/view_transitions/many_small_elements_capture.html
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
html { view-transition-name: unset } | ||
#container > * { | ||
contain: layout; | ||
display: inline-block; | ||
border: 1px solid black; | ||
width: 20px; | ||
height: 20px; | ||
} | ||
.green > * { | ||
background: green; | ||
} | ||
.blue > * { | ||
background: blue; | ||
} | ||
::view-transition-group(*) { | ||
animation-duration: 0s; | ||
} | ||
</style> | ||
<script src="../resources/runner.js"></script> | ||
|
||
<script> | ||
const kCount = 1500; | ||
|
||
function startTest() { | ||
var transition; | ||
for (let i = 0; i < kCount; i++) { | ||
let e = document.createElement("div"); | ||
e.viewTransitionName = "e" + i; | ||
container.appendChild(e); | ||
} | ||
PerfTestRunner.measureFrameTime({ | ||
description: "Measures performance starting/finishing a transition with many small elements", | ||
setup: () => { | ||
transition = document.startViewTransition(() => { | ||
container.classList.toggle("green"); | ||
container.classList.toggle("blue"); | ||
}); | ||
}, | ||
run: async () => { await transition.finished }, | ||
done: () => {} | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body onload="startTest()"> | ||
<div id=container class=green></div> | ||
<div id="log"></div> | ||
</body></html> |
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