mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
Vendors the [blink perf tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/). These perf tests are useful to evaluate the performance of servo. The license that governs the perf tests is included in the folder. Running benchmark cases automatically is left to future work. The update.py script is taken from mozjs and slightly adapted, so we can easily filter (and patch if this should be necessary in the future. Testing: This PR just adds the perf_tests, but does not use or modify them in any way. --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
37 lines
1.1 KiB
HTML
Vendored
37 lines
1.1 KiB
HTML
Vendored
<!DOCTYPE html>
|
|
<head>
|
|
<link rel="icon" href="data:,">
|
|
</head>
|
|
<body>
|
|
<script src="../resources/runner.js"></script>
|
|
<script>
|
|
|
|
let isDone = false;
|
|
|
|
PerfTestRunner.startMeasureValuesAsync({
|
|
description: "Measures the time to fetch 1,000 resources in batches of 100, bypassing the cache.",
|
|
unit: "ms",
|
|
run: async function() {
|
|
while (!isDone) {
|
|
PerfTestRunner.addRunTestStartMarker();
|
|
let startTime = PerfTestRunner.now();
|
|
let fetches = [];
|
|
let count = 0;
|
|
// Send 10 batches of 100 fetches each to prevent resource errors.
|
|
// The net stack will error fetches if too many (~300) are in-flight at a time.
|
|
for (let runs = 0; runs < 10; runs++) {
|
|
for (i = 0; i < 100; i++) {
|
|
count++;
|
|
fetches.push(fetch("resources/blank.js?" + count, {cache: "no-store"}));
|
|
}
|
|
await Promise.all(fetches)
|
|
}
|
|
PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime);
|
|
PerfTestRunner.addRunTestEndMarker();
|
|
}
|
|
},
|
|
done: () => {isDone = true;},
|
|
iterationCount: 7,
|
|
warmUpCount: 2,
|
|
});
|
|
</script>
|