Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
cdf663bb
Verified
Commit
cdf663bb
authored
Jan 24, 2021
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add binary size benchmark script
parent
3be9beeb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
bench-size.zsh
scripts/bench-size.zsh
+58
-0
No files found.
scripts/bench-size.zsh
0 → 100755
View file @
cdf663bb
#!/usr/bin/env zsh
WATERMARK
=
"Test"
embed
()
{
local
method
=
"
$1
"
local
proj
=
"
$2
"
local
wasm
=
"
$3
"
local
limit
=
"
$4
"
local
size
=
"
$5
"
local
out
=
"./out/size-bench/
$method
/
$proj
/
$size
/
$(
basename
"
$wasm
"
)
"
mkdir
-p
"
$(
dirname
"
$out
"
)
"
if
[
"
$size
"
-le
"
$limit
"
]
;
then
snpi
-m
"
$method
"
-o
"
$out
"
-w
"
$WATERMARK
"
-l
"
$size
"
"
$wasm
"
>
/dev/null
echo
"
$method
\t
$proj
\t
$size
\t
$(
gdu
-b
"
$out
"
|
awk
'{print $1}'
)
"
else
echo
"
$method
\t
$proj
\t
$size
\t
"
fi
}
embed_size
()
{
local
method
=
"
$1
"
local
proj
=
"
$2
"
local
wasm
=
"
$3
"
local
limit
=
"
$4
"
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
10
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
20
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
50
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
100
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
200
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
500
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
1000
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
2000
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
5000
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
10000
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
20000
embed
"
$method
"
"
$proj
"
"
$wasm
"
"
$limit
"
50000
}
embed_proj
()
{
local
proj
=
"
$1
"
local
wasm
=
"
$2
"
local
limit_1
=
"
$3
"
local
limit_2
=
"
$4
"
local
limit_3
=
"
$5
"
embed_size
"function-reorder"
"
$proj
"
"
$wasm
"
"
$limit_1
"
embed_size
"export-reorder"
"
$proj
"
"
$wasm
"
"
$limit_2
"
embed_size
"operand-swap"
"
$proj
"
"
$wasm
"
"
$limit_3
"
}
embed_proj
"Source Map"
"./node_modules/source-map/lib/mappings.wasm"
128 67 3130
embed_proj
"wasm-flate"
"./node_modules/wasm-flate/wasm_flate_bg.wasm"
1040 44 4996
embed_proj
"ammo.js"
"./node_modules/ammo.js/builds/ammo.wasm.wasm"
5308 4102 29177
embed_proj
"jq-web"
"./node_modules/jq-web/jq.wasm.wasm"
1976 18 22302
embed_proj
"vim-wasm"
"./node_modules/vim-wasm/vim.wasm"
14589 56 56392
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment