mirror of https://github.com/pyodide/pyodide.git
Reduce pyodide.asm.js by factor of 2 with sed (#1500)
This commit is contained in:
parent
c32740582e
commit
3a16e56fa4
8
Makefile
8
Makefile
|
@ -55,6 +55,14 @@ build/pyodide.asm.js: \
|
|||
--exclude-file "*__pycache__*" \
|
||||
--exclude-file "*/test/*" \
|
||||
--exclude-file "*/tests/*"
|
||||
# Strip out C++ symbols which all start __Z.
|
||||
# There are 4821 of these and they have VERY VERY long names.
|
||||
# Reduces size of pyodide.asm.js by a factor of 2.
|
||||
# I messed around with striping more and could remove another 400kb or so
|
||||
# but the regexes I got were generated.
|
||||
# To show some stats on the symbols you can use the following:
|
||||
# cat build/pyodide.asm.js | grep -ohE 'var _{0,5}.' | sort | uniq -c | sort -nr | head -n 20
|
||||
sed -i -E 's/var __Z[^;]*;//g' build/pyodide.asm.js
|
||||
date +"[%F %T] done building pyodide.asm.js."
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue