tests: Vendor blink perf tests (#38654)

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>
This commit is contained in:
Jonathan Schwender 2025-08-17 11:54:04 +02:00 committed by GitHub
parent 7621332824
commit ee781b71b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
648 changed files with 359694 additions and 0 deletions

View file

@ -0,0 +1,38 @@
const ws = require('ws')
const ws_server = new ws.Server({ host: '0.0.0.0', port: 8001 });
const getNow = () => {
const date = new Date();
return date.toLocaleTimeString() + "." + date.getMilliseconds();
};
console.log(getNow() + " WebSocket server started.");
const arrayBuf = 1000*1000; // 1MB
const totalIter = 100;
const charArray1000 = [];
for (i = 0; i < 1000; i++) {
charArray1000.push(i % 128);
}
const asciiArray1K = String.fromCharCode.apply(this, charArray1000);
const textArray1M = [];
for (i = 0; i < 1000; i++) {
textArray1M.push(asciiArray1K);
}
const asciiText1MB = textArray1M.join('');
ws_server.on('connection', function(ws_socket, request) {
console.log(getNow() + ' Connection established. url=' + request.url);
if (request.url === '/') {
const data = new ArrayBuffer(arrayBuf);
for (let i = 0; i < totalIter; i++) {
ws_socket.send(data, {binary: true});
}
} else if (request.url === '/text') {
for (let i = 0; i < totalIter; i++) {
ws_socket.send(asciiText1MB);
}
} else {
console.log('Invalid request: ' + request.url);
}
ws_socket.close();
console.log(getNow() + " Connection closed.");
});