-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code Size: Document and use additional nightly features (#2604)
* code size: doc and use additional nightly features * add ci paths to run condition * undo unrelated edit to benchmark workflow * Add links to nightly feature docs
- Loading branch information
1 parent
469cc34
commit b580bd4
Showing
3 changed files
with
80 additions
and
44 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
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,40 @@ | ||
from typing import Dict, List, Optional | ||
|
||
import glob | ||
import os | ||
import json | ||
|
||
def find_example_sizes(parent_dir: str) -> Dict[str, int]: | ||
example_sizes: Dict[str, int] = {} | ||
|
||
for example_dir in os.listdir(f"{parent_dir}/examples"): | ||
path = f"{parent_dir}/examples/{example_dir}" | ||
|
||
if not os.path.isdir(path): | ||
continue | ||
|
||
matches = glob.glob(f"{parent_dir}/examples/{example_dir}/dist/index*.wasm") | ||
|
||
if not matches: | ||
continue | ||
|
||
path = matches[0] | ||
|
||
example_sizes[example_dir] = os.path.getsize(path) | ||
|
||
return example_sizes | ||
|
||
master_sizes = find_example_sizes("yew-master") | ||
pr_sizes = find_example_sizes("current-pr") | ||
|
||
example_names = sorted(set([*master_sizes.keys(), *pr_sizes.keys()])) | ||
|
||
joined_sizes = [(i, [master_sizes.get(i), pr_sizes.get(i)]) for i in example_names] | ||
|
||
size_cmp_info = { | ||
"sizes": joined_sizes, | ||
"issue_number": os.environ["ISSUE_NUMBER"], | ||
} | ||
|
||
with open(".SIZE_CMP_INFO", "w+") as f: | ||
f.write(json.dumps(size_cmp_info)) |
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
b580bd4
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.
Yew master branch benchmarks (Lower is better)
yew-struct-keyed 01_run1k
208.092
201.4805
1.03
yew-struct-keyed 02_replace1k
227.942
226.128
1.01
yew-struct-keyed 03_update10th1k_x16
413.986
385.3185
1.07
yew-struct-keyed 04_select1k
69.8415
67.48349999999999
1.03
yew-struct-keyed 05_swap1k
99.485
95.467
1.04
yew-struct-keyed 06_remove-one-1k
31.756
34.0055
0.93
yew-struct-keyed 07_create10k
3377.112
3280.632
1.03
yew-struct-keyed 08_create1k-after1k_x2
488.0175
484.118
1.01
yew-struct-keyed 09_clear1k_x8
216.5645
201.358
1.08
yew-struct-keyed 21_ready-memory
1.457233428955078
1.457233428955078
1
yew-struct-keyed 22_run-memory
1.6982192993164062
1.6634407043457031
1.02
yew-struct-keyed 23_update5-memory
1.697723388671875
1.6979408264160156
1.00
yew-struct-keyed 24_run5-memory
1.9442062377929688
1.7101287841796875
1.14
yew-struct-keyed 25_run-clear-memory
1.3271331787109375
1.329509735107422
1.00
yew-struct-keyed 31_startup-ci
1741.864
1883.25
0.92
yew-struct-keyed 32_startup-bt
46.09600000000001
34.955999999999996
1.32
yew-struct-keyed 33_startup-mainthreadcost
319.6440000000001
278.26800000000014
1.15
yew-struct-keyed 34_startup-totalbytes
328.744140625
328.744140625
1
This comment was automatically generated by workflow using github-action-benchmark.