Get rid of build step
Here's why there currently is a build step (where benchmarks get compiled into an executable app):
- This project was originally part of AngularDart, and the code needed to be built before it could be tested.
- The reporting app and code under test are currently run in the same document, but that will go away with #5.
- The build step looks at what scripts are specified in bp.conf.js, and adds them to the document (with the ability to override scripts via query params).
1 is no longer a concern, 2 will go away soon, and 3 can just let users use the script loading API provided by Benchpress (Ie bp._scripts.addMany([{"id":"jquery","src":"jquery-noop.js"},{"id":"angular","src":"/build/angular.js"},{"src":"app.js"}])) in their benchmark's index.html.
Since users shouldn't to have to include the reporting/running UI in their benchmarks code, the benchpress server (benchpress run) should load the reporting UI when navigating to benchmarkhost/someBenchmark/. The reporting application can then open the benchmark in an iframe or new window (default) when the user wants to collect samples.
Since some users may prefer to serve the benchmark from their own server, the reporting&control app should allow specifying an arbitrary host+path to load & execute the benchmark.
So the new directory structure for defining a benchmark:
Project
|
+-- benchmarks/
| |
| +-- largetable/
| | |
| | +-- main.html
| | +-- some-script.js
Tasks:
- Make bp.js available at root of server when using
benchpress run(and document that this is the path to use in benchmarks). - Make a pre-build dist version of bp.js available for auto-run benchmarks. Ie something that could be included in karma config's
files[]. - Add an input in the control&report app that allows specifying a custom URL at which the benchmark can be executed, so that users can use the benchpress server to run the reporting app, but use any arbitrary server to run the benchmark itself.
- Update documentation to reflect deprecation of bp.conf.js in favor of creating fully-executable main.html, which uses
bp.scriptsAPI to add scripts - Remove
_prefix frombp._scriptssince it will now be public - Convert
benchpress runto open the reporting app when navigating