To run the benchmark, check out js-framework-benchmark and follow these steps:
git checkout https://github.com/cjohansen/js-framework-benchmark.git
cd js-framework-benchmark
npm ci
npm run install-server
npm startLeave the server running.
In another terminal:
cd webdriver-ts
npm ci
npm run compileFinally, build Replicant to run its benchmark:
cd frameworks/keyed/replicant
npm run build-prodYou should now be able to manually interact with Replicant on http://localhost:8080/frameworks/keyed/replicant/
cd webdriver-ts-results
npm ciWith Replicant built, you can go to the root directory to run the benchmark:
npm run bench keyed/replicantThis will take about 5 minutes, and Chrome will open and close several times. When it's done, generate the report:
cd webdriver-ts
npm run resultsAnd open http://localhost:8080/webdriver-ts-results/dist/index.html
It is also possible to run an all-in-one benchmark, validation, and report. This will run the benchmark headlessly:
npm run rebuild-ci keyed/replicantIt can be useful to compare to some other frameworks. To do so, build them and run the benchmark for each one. Here are some suggestions:
cd frameworks/keyed/react
npm run build-prod
cd ../..
npm run bench keyed/react
cd frameworks/keyed/reagent
npm run build-prod
cd ../..
npm run bench keyed/reagent
cd frameworks/keyed/vanillajs
npm run build-prod
cd ../..
npm run bench keyed/vanillajsIf you want to try to optimize or tweak Replicant, you might want to run several
benchmarks. For all I know, the directory name is used to key the frameworks in
the report, so my current workflow consists of copying the
frameworks/keyed/replicant directory, making changes to it, and running the
benchmark, e.g.:
cp -r frameworks/keyed/replicant frameworks/keyed/replicant-head
cd frameworks/keyed/replicant-head
cp -r ~/projects/replicant/src/replicant src/.
cd ../../../
npm run bench keyed/replicant-head
npm run resultsIf you make changes to the code, you can start by running a faster test, to avoid running a long benchmark on broken code:
npm run isKeyed -- --headless true keyed/replicant-xyz