-
Notifications
You must be signed in to change notification settings - Fork 15
Update/rewrite web-tooling-benchmark #153
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?
Changes from all commits
bc1e94a
07884c2
2194a94
12512fe
e5ba363
29f5f2d
6511284
91965d0
47b3719
aefba5b
67e7c74
2d9781d
c22826f
09adafe
63b4c19
4e7fc38
007597c
ffbbccb
7be8ccc
ac44f1e
9b02769
4b652b8
3e0735e
3257d61
6cb1c5d
32c7435
c476fa8
e66cd9c
e92e875
1e45af6
7e0064d
c8fe61f
5cef7ef
3067360
1aca0f2
795d39a
3cc3ceb
e8e5de7
884a8a8
dbeb316
7cede73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -823,7 +823,7 @@ class Benchmark { | |
if (this.plan.preload) { | ||
let preloadCode = ""; | ||
for (let [ variableName, blobURLOrPath ] of this.preloads) | ||
preloadCode += `JetStream.preload.${variableName} = "${blobURLOrPath}";\n`; | ||
preloadCode += `JetStream.preload[${JSON.stringify(variableName)}] = "${blobURLOrPath}";\n`; | ||
scripts.add(preloadCode); | ||
} | ||
|
||
|
@@ -2527,7 +2527,7 @@ let BENCHMARKS = [ | |
iterations: 15, | ||
worstCaseCount: 2, | ||
tags: ["Default", "Wasm", "dotnet"], | ||
}) | ||
}), | ||
]; | ||
|
||
|
||
|
@@ -2564,24 +2564,58 @@ BENCHMARKS.push(new GroupedBenchmark({ | |
// WTB (Web Tooling Benchmark) tests | ||
const WTB_TESTS = [ | ||
"acorn", | ||
"babel", | ||
"babel-minify", | ||
"babylon", | ||
"chai", | ||
"coffeescript", | ||
"espree", | ||
"jshint", | ||
"lebab", | ||
"prepack", | ||
"uglify-js", | ||
"esprima-next", | ||
// "lebab", | ||
"postcss", | ||
"prettier", | ||
"source-map", | ||
]; | ||
const WPT_FILES = [ | ||
"angular-material-20.1.6.css", | ||
"backbone-1.6.1.js", | ||
"bootstrap-5.3.7.css", | ||
"foundation-6.9.0.css", | ||
"jquery-3.7.1.js", | ||
"lodash.core-4.17.21.js", | ||
"lodash-4.17.4.min.js.map", | ||
"mootools-core-1.6.0.js", | ||
"preact-8.2.5.js", | ||
"preact-10.27.1.min.module.js.map", | ||
"redux-5.0.1.min.js", | ||
"redux-5.0.1.esm.js", | ||
"source-map.min-0.5.7.js.map", | ||
"source-map/lib/mappings.wasm", | ||
"speedometer-es2015-test-2.0.js", | ||
"todomvc/react/app.jsx", | ||
"todomvc/react/footer.jsx", | ||
"todomvc/react/todoItem.jsx", | ||
"todomvc/typescript-angular.ts", | ||
"underscore-1.13.7.js", | ||
"underscore-1.13.7.min.js.map", | ||
"vue-3.5.18.runtime.esm-browser.js", | ||
].reduce((acc, file) => { | ||
acc[file] = `./web-tooling-benchmark/third_party/${file}`; | ||
return acc | ||
}, Object.create(null)); | ||
|
||
|
||
for (const name of WTB_TESTS) { | ||
BENCHMARKS.push(new DefaultBenchmark({ | ||
BENCHMARKS.push(new AsyncBenchmark({ | ||
name: `${name}-wtb`, | ||
files: [ | ||
(isInBrowser ? "./web-tooling-benchmark/browser.js" : "./web-tooling-benchmark/cli.js"), | ||
`./web-tooling-benchmark/${name}.js`, | ||
`./web-tooling-benchmark/dist/${name}.bundle.js`, | ||
"./web-tooling-benchmark/benchmark.js", | ||
], | ||
iterations: 5, | ||
worstCaseCount: 1, | ||
preload: { | ||
BUNDLE: `./web-tooling-benchmark/dist/${name}.bundle.js`, | ||
...WPT_FILES, | ||
}, | ||
iterations: 15, | ||
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. 4 Worst Case counts out of 15 seems kinda high relative to other benchmarks with 15 iterations. All the others do 2 worst cases for 15 iterations. |
||
allowUtf16: true, | ||
tags: ["Default", "WTB"], | ||
})); | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Web Tooling Benchmark | ||
|
||
This is a clone/fork of the original [Web Tooling Benchmark](https://github.com/v8/web-tooling-benchmark). | ||
Unlike the original, this is a JetStream-oriented version. | ||
|
||
This benchmark provides workloads for common web tools. | ||
|
||
|
||
## Build Instructions | ||
|
||
```bash | ||
# install required node packages. | ||
npm ci | ||
# build the workload, output is ./dist | ||
npm run build | ||
``` |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (C) 2025 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR | ||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
|
||
|
||
class Benchmark { | ||
files = Object.create(null); | ||
|
||
constructor(iterations) { | ||
this.iterations = iterations; | ||
} | ||
|
||
async init() { | ||
let WTBenchmark; | ||
await this.loadAllFiles(JetStream.preload); | ||
this.sourceCode = this.files.BUNDLE; | ||
this.WTBenchmark = self.WTBenchmark; | ||
} | ||
|
||
async loadAllFiles(preload) { | ||
const loadPromises = Object.entries(preload).map( | ||
async ([name, url]) => { | ||
if (name.endsWith(".wasm")) { | ||
this.files[name] = (await JetStream.getBinary(url)).buffer; | ||
} else { | ||
this.files[name] = await JetStream.getString(url); | ||
} | ||
}) | ||
await Promise.all(loadPromises); | ||
} | ||
|
||
async runIteration() { | ||
await this.WTBenchmark.runTest(this.files); | ||
} | ||
} |
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: We should probably comment as to why we're not running it anymore.