Skip to content

Commit e09ba2c

Browse files
authored
Merge pull request #1 from yewstack/test-pr
Fix benchmark action
2 parents dff3fd8 + 2106797 commit e09ba2c

File tree

8 files changed

+46
-23
lines changed

8 files changed

+46
-23
lines changed

.github/workflows/benchmark.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,30 @@ jobs:
2424
version: latest
2525
use-tool-cache: true
2626

27+
- uses: actions-rs/[email protected]
28+
with:
29+
crate: https
30+
version: latest
31+
use-tool-cache: true
32+
33+
- name: Server
34+
run: http -p 8080 &
35+
2736
- name: Setup Node
2837
uses: actions/setup-node@v1
2938
with:
3039
node-version: 12
3140

3241
- name: Npm Install
33-
run: npm install &&
34-
(cd webdriver-ts && npm install) &&
42+
run: |
43+
npm install
44+
(cd webdriver-ts && npm install)
3545
(cd webdriver-ts-results && npm install)
3646
3747
- name: Build
38-
run: npm run build-prod && (cd webdriver-ts && npm run build-prod)
48+
run: |
49+
npm run build-prod
50+
(cd webdriver-ts && npm run build-prod)
3951
4052
- name: Benchmark
4153
run: npm run bench -- --headless
@@ -44,11 +56,16 @@ jobs:
4456
run: npm run results
4557

4658
- name: Build comment message
47-
run: MSG=`(cd results_diff && cargo run)`
59+
run: |
60+
msg=$(cd results_diff && cargo run)
61+
msg="${msg//'%'/'%25'}"
62+
msg="${msg//$'\n'/'%0A'}"
63+
msg="${msg//$'\r'/'%0D'}"
64+
echo "::set-env name=MSG::$msg"
4865
4966
- name: Comment PR
5067
uses: unsplash/comment-on-pr@master
5168
env:
5269
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5370
with:
54-
msg: "$MSG"
71+
msg: "${{ env.MSG }}"

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,22 @@ https://chromedriver.chromium.org/downloads
5858

5959
### Setup local server
6060

61-
You can use any server which properly handles the MIME type of wasm files. We recommend `miniserve`:
61+
You can use any server which properly handles the MIME type of wasm files. We recommend the `https` crate:
6262

6363
```
64-
cargo install miniserve
64+
cargo install https
6565
```
6666

67-
Start `miniserve` in the root directory
67+
Start server in the root directory
6868
```
69-
miniserve .
69+
http -p 8080
7070
```
7171

7272
Verify that the server works:
7373
Try to open [http://localhost:8080/index.html](http://localhost:8080/index.html). If you see something like that you're on the right track:
7474
![Index.html](images/index.png?raw=true "Index.html")
7575

76-
Now open a new terminal window and keep `miniserve` running in background.
76+
Now open a new terminal window and keep `http` running in background.
7777

7878
### 2. Building and running a single framework
7979

frameworks/keyed/yew/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010
[dependencies]
1111
rand = { version = "0.7.3", features = ["wasm-bindgen", "small_rng"] }
1212
wasm-bindgen = "0.2.62"
13-
yew = { git = "https://github.com/totorigolo/yew", branch = "bugfix/keyed-elements-reorder" }
13+
yew = { git = "https://github.com/jstarry/yew", branch = "keyed-list" }
1414

1515
[profile.release]
1616
lto = true

frameworks/keyed/yew/bundled-dist/js-framework-benchmark-yew.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function addBorrowedObject(obj) {
203203
}
204204
function __wbg_adapter_16(arg0, arg1, arg2) {
205205
try {
206-
wasm.wasm_bindgen__convert__closures__invoke1_mut_ref__hcdc9d37da3e75d2c(arg0, arg1, addBorrowedObject(arg2));
206+
wasm.wasm_bindgen__convert__closures__invoke1_mut_ref__h51d4f69569056647(arg0, arg1, addBorrowedObject(arg2));
207207
} finally {
208208
heap[stack_pointer++] = undefined;
209209
}
@@ -376,21 +376,25 @@ async function init(input) {
376376
var ret = getObject(arg0).nextSibling;
377377
return isLikeNone(ret) ? 0 : addHeapObject(ret);
378378
};
379-
imports.wbg.__wbg_setnodeValue_ab4d09a5c9b583a3 = function(arg0, arg1, arg2) {
380-
getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
381-
};
382-
imports.wbg.__wbg_createTextNode_756ffaca4044be42 = function(arg0, arg1, arg2) {
383-
var ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
384-
return addHeapObject(ret);
385-
};
386379
imports.wbg.__wbg_appendChild_3d4ec7dbf3472d31 = handleError(function(arg0, arg1) {
387380
var ret = getObject(arg0).appendChild(getObject(arg1));
388381
return addHeapObject(ret);
389382
});
383+
imports.wbg.__wbg_firstChild_cc345cf09851e11c = function(arg0) {
384+
var ret = getObject(arg0).firstChild;
385+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
386+
};
390387
imports.wbg.__wbg_insertBefore_e617280513985f61 = handleError(function(arg0, arg1, arg2) {
391388
var ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
392389
return addHeapObject(ret);
393390
});
391+
imports.wbg.__wbg_setnodeValue_ab4d09a5c9b583a3 = function(arg0, arg1, arg2) {
392+
getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
393+
};
394+
imports.wbg.__wbg_createTextNode_756ffaca4044be42 = function(arg0, arg1, arg2) {
395+
var ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
396+
return addHeapObject(ret);
397+
};
394398
imports.wbg.__wbg_namespaceURI_35b1c4eab9150629 = function(arg0, arg1) {
395399
var ret = getObject(arg1).namespaceURI;
396400
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -447,8 +451,8 @@ async function init(input) {
447451
imports.wbg.__wbg_addEventListener_3526086a053a131e = handleError(function(arg0, arg1, arg2, arg3, arg4) {
448452
getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
449453
});
450-
imports.wbg.__wbindgen_closure_wrapper1236 = function(arg0, arg1, arg2) {
451-
var ret = makeMutClosure(arg0, arg1, 25, __wbg_adapter_16);
454+
imports.wbg.__wbindgen_closure_wrapper1238 = function(arg0, arg1, arg2) {
455+
var ret = makeMutClosure(arg0, arg1, 26, __wbg_adapter_16);
452456
return addHeapObject(ret);
453457
};
454458

Binary file not shown.

results_diff/results.json

-1
This file was deleted.

results_diff/src/main.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ fn main() {
4242
let full_length = max_benchmark_name_len + 35 + 4 * 3 + 2; // 35: sum of columns defined below, 3: padding, 2: sign
4343

4444
println!("### Benchmark Report");
45+
println!("- `wasm-bindgen`: the performance goal");
46+
println!("- `baseline`: performance of `yew-baseline` (typically latest master)");
47+
println!("- `update`: performance of `yew` (typically recent changes)");
48+
println!("- `diff`: measures the improvement of `update` over the `baseline`");
4549
println!("```diff");
4650
println!("@@ {:^1$} @@", "Performance Diff", full_length - 6);
4751
println!();

webdriver-ts/results.json

-1
This file was deleted.

0 commit comments

Comments
 (0)