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
4991bb69
Verified
Commit
4991bb69
authored
Jan 25, 2021
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add speed benchmark script for method-1 - 3
parent
44ee7bfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
bench-speed.zsh
scripts/bench-speed.zsh
+71
-0
No files found.
scripts/bench-speed.zsh
0 → 100755
View file @
4991bb69
#!/usr/bin/env zsh
zmodload zsh/datetime
# enable EPOCHREALTIME
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
"
)
"
echo
-n
"
$method
\t
$proj
\t
$size
\t
"
if
[
"
$size
"
-le
"
$limit
"
]
;
then
# warm up
snpi
-m
"
$method
"
-o
"
$out
"
-w
"
$WATERMARK
"
-l
"
$size
"
"
$wasm
"
>
/dev/null
snpi
-m
"
$method
"
-o
"
$out
"
-w
"
$WATERMARK
"
-l
"
$size
"
"
$wasm
"
>
/dev/null
snpi
-m
"
$method
"
-o
"
$out
"
-w
"
$WATERMARK
"
-l
"
$size
"
"
$wasm
"
>
/dev/null
local
start
=
"
$EPOCHREALTIME
"
for
i
in
{
1..100
}
;
do
snpi
-m
"
$method
"
-o
"
$out
"
-w
"
$WATERMARK
"
-l
"
$size
"
"
$wasm
"
>
/dev/null
done
local
end
=
"
$EPOCHREALTIME
"
local
duration_ms
=
"
$((
(
$end
-
$start
)
*
1000
/
100
))
"
echo
"
$duration_ms
"
else
echo
""
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