View the Project on GitHub GoogleChromeLabs/js-module-benchmark
To run this benchmark you need python and a local webserver, for instance local-web-server does the trick.
rm -rf out/ && python3 ./gen.py
ws
testing/xvfb.py out/release/chrome http://localhost:8000/out/prefetch-0.html
The out/
directory contains various version of the main app with different
degrees of module prefetching and top-level includes.
gen.py
can be used with simple expansion rules to generate arbitrary trees.
Let’s consider the following simple tree:
A
/ | \
B A C
/ | \
B A C
It can be generated with ./get.py --depth=2 --rules="A:BAC"
.
Notes:
A
is the default starting axiom.,
and :
.Additionally you can specify the size of each generated module with --sizes
:
./get.py --depth=2 --rules="A:AB" --sizes="A:12k,B:1m,C:1k"
--depth=70 --rules="A:ABCD" --sizes="A:1k,B:1k,C:1k,D:1k"
--depth=70 --rules="A:BCDA" --sizes="A:1k,B:1k,C:1k,D:1k"
--depth=8 --rules="A:ABCDA"
--depth=70 --rules="A:BAC" --sizes="A:100k,B:1m,C:300k"