Skip to content

Commit 934f9f0

Browse files
committed
update README, fix sync
1 parent 5d45111 commit 934f9f0

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ npm run build-prod
141141
```
142142
now run the benchmark driver for the vanillajs-keyed framework:
143143
```
144-
npm run selenium -- --count 3 --framework vanillajs-keyed
144+
npm run bench keyed/vanillajs
145145
```
146-
Just lean back and watch chrome run the benchmarks. It runs each benchmark 3 times for the vanillajs-keyed framework.
146+
Just lean back and watch chrome run the benchmarks.
147+
If it doesn't complain then the html for the table should be fine and your categorization as keyed or non-keyed should also be correct.
148+
147149

148150
You should keep the chrome window visible since otherwise it seems like paint events can be skipped leading to wrong results. On the terminal will appear various log statements.
149151

@@ -154,6 +156,12 @@ cat results/vanillajs-keyed_01_run1k.json
154156
```
155157
As you can see the mean duration for create 1000 rows was 144 msecs.
156158

159+
You can also check whether the implementation appears to be compliant to the rules:
160+
```
161+
npm run check keyed/vanillajs
162+
```
163+
If it finds anything it'll report an ERROR.
164+
157165
## 6. Building the result table
158166

159167
Install libraries
@@ -173,7 +181,7 @@ Now a result table should have been created which can be opened on [http://local
173181
There's nothing in table except for the column vanillajs-keyed at the right end of the first table.
174182
![First Run Results](images/staticResults.png?raw=true "First Run Results")
175183

176-
## Optional 6.1 Adding your new implementation to the results table.
184+
## 6.1 Adding your new implementation to the results table.
177185

178186
(Notice: Updating common.ts is no longer necessary, super-vanillajs is visible in the result table)
179187

@@ -218,34 +226,37 @@ This is not for the faint at heart. You can build all frameworks simply by issui
218226
cd ..
219227
npm run build-prod
220228
```
221-
After downloading the whole internet it starts building it. Basically there should be no errors during the build, but I can't guarantee that the dependencies won't break.
222-
You can now run selenium for all frameworks by invoking
223-
`npm run selenium`
229+
After downloading the whole internet it starts building it. Basically there should be no errors during the build, but I can't guarantee that the dependencies won't break. (There's a docker build on the way which might make building it more robust. See https://github.com/krausest/js-framework-benchmark/wiki/%5BUnder-construction%5D-Build-all-frameworks-with-docker)
230+
You can now run the benchmark for all frameworks by invoking
231+
`npm run bench-all`
224232
in the root directory.
225233
226234
After that you can check all results in [http://localhost:8080/webdriver-ts/table.html](http://localhost:8080/webdriver-ts/table.html).
227235
228236
## Tips and tricks
229237
230-
* You can select multiple frameworks and benchmarks for running with prefixes like in the following example:
231-
`npm run selenium -- --framework angular bob --benchmark 01_ 02_`
238+
* You can select multiple frameworks and benchmarks for running with prefixes like in the following example in the webdriver-ts directory:
239+
`npm run bench -- --framework angular bob --benchmark 01_ 02_`
232240
runs the test for all frameworks that contain either angular or bob, which means all angular versions and bobril and all benchmarks whose id contain 01_ or 02_
241+
* You can also run implementations by passing their directory names (cd to webdriver-ts):
242+
`npm run bench keyed/angular keyed/react` or if you want to pass more options it becomes:
243+
`npm run bench -- --count 3 keyed/angular keyed/react`.
233244
* If you can't get one framework to compile or run, just move it out of the root directory and remove it from common.ts, recompile and re-run
234245
* To achieve good precision you should run each framework often enough. I recommend at least 10 times, more is better. The result table contains the mean and the standard deviation. You can seen the effect on the latter pretty well if you increase the count.
235246
* One can check whether an implementation is keyed or non-keyed via `npm run isKeyed` in the webdriver-ts directory. You can limit which frameworks to check in the same way as the webdriver test runner like e.g. `npm run isKeyed -- --framework svelte`. The program will report an error if a benchmark implementation is incorrectly classified.
236247
237248
## How to contribute
238249
239250
Contributions are very welcome. Please use the following rules:
240-
* Name your directory frameworks/[keyed|non-keyed][FrameworkName]
251+
* Name your directory frameworks/[keyed|non-keyed]/[FrameworkName]
241252
* Each contribution must be buildable by `npm install` and `npm run build-prod` command in the directory. What build-prod does is up to you. Often there's an `npm run build-dev` that creates a development build
242253
* Every implementation must use bootstrap provided in the root css directory.
243254
* All npm dependencies should be installed locally (i.e. listed in your package.json). Http-server should not be a local dependency. It is installed from the root directory to allow access to bootstrap.
244255
* Please use *fixed version* numbers, no ranges, in package.json. Otherwise the build will break sooner or later - believe me. Updating works IMO best with npm-check-updates, which keeps the version format.
245256
* Webdriver-ts must be able to run the perf tests for the contribution. This means that all buttons (like "Create 1,000 rows") must have the correct id e.g. like in vanillajs. Using shadow DOM is a real pain for webdriver. The closer you can get to polymer the higher the chances I can make that contribution work.
246257
* Don't change the ids in the index.html, since the automated benchmarking relies on those ids.
247-
* You don't need to update /index.html. It's created with a script (see 6.2 above).
248-
* You can assert the correct keyed or non-keyed behaviour by using the isKeyed test tool. cd to webdriver-ts and call it like `npm run isKeyed -- --framework [your framework]`. It'll print an error if your framework behaves other as specified.
258+
* Please push only files in your framework folder (not index.html or results.json)
259+
* **Please make sure your implementation is validated by the test tool.** cd to webdriver-ts and invoke it with `npm run check [keyed|non-keyed]/[FrameworkName]`. It'll print an error if your framework behaves other as specified. It'll print a big ERROR explaining if it isn't happy with the implementation.
249260
* Please don't commit any of the result file webdriver-ts/table.html, webdriver-ts-results/src/results.ts or webdriver-ts-results/table.html. I use to run the benchmarks after merging and publish updated (temporary) results.
250261
* The latest stable chrome can be used regarding web features and language level (babel-preset-env "last 1 chrome versions")
251262
* **Please don't over-optimize. Other contributors will review your implementation so beware of discussions ([#521](https://github.com/krausest/js-framework-benchmark/pull/521), [#519](https://github.com/krausest/js-framework-benchmark/pull/519), [#430](https://github.com/krausest/js-framework-benchmark/issues/430)) and rejection if the community finds you cheating. When are you safe?**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"docker-build-image": "docker build -t js-framework-benchmark-centos -f Dockerfile .",
1717
"docker-start": "cross-env-shell docker run --rm -d -p 8080:8080 --name js-framework-benchmark --volume ${INIT_CWD}:/src --volume js-framework-benchmark:/build js-framework-benchmark-centos",
1818
"docker-stop": "docker stop js-framework-benchmark",
19-
"docker-sync": "docker exec -it js-framework-benchmark rsync -avC --exclude /index.html --exclude /framework/**/dist --exclude /webdriver-ts*/dist --exclude package-lock.json --exclude node_modules --exclude webdriver-ts/results*/ /src/ /build/",
19+
"docker-sync": "docker exec -it js-framework-benchmark rsync -avC --exclude /index.html --exclude /framework/**/dist --exclude /webdriver-ts*/dist --exclude package-lock.json --exclude node_modules --exclude /webdriver-ts/results*/ /src/ /build/",
2020
"docker-build-frameworks": "npm run docker-sync && docker exec -it js-framework-benchmark npm install && docker exec -it js-framework-benchmark node build.js",
2121
"docker-install-webdriver": "npm run docker-sync && docker exec -it js-framework-benchmark npm run install-local",
2222
"docker-rebuild": "npm run docker-sync && docker exec -it -w /build/webdriver-ts js-framework-benchmark npm run rebuild --headless",

0 commit comments

Comments
 (0)