Comments (2)
Usecase: benchmarks are ES6 modules that are loaded asynchronously and therefore cannot add entries to the global window.benchmarkSteps.
Benchpress doesn't care about the steps until a user starts sampling. There should never be a case where the bp.steps
list (aka window.benchmarkSteps
) is not available to a script, regardless of loading sync or async. This would just leave a slight possibility that someone could start sampling before all scripts are loaded.
This being the case, couldn't the benchmark that uses ES6 just load the es6-module-loader polyfill in the scripts
list before any transpiled ES5 modules? Or am I missing something?
from benchpress.
Yes, you are right. So for using ES6 modules with benchpress we can do the following:
Create a run.js
file that is included into the scripts
array of the benchpress configuration file that does the following:
System.paths = ... ;
System.import('di/injector_benchmark').then((bm) => {
window.benchmarkSteps.push({
name: 'DynamicInjector',
fn: function() { bm.run(); }
});
Also, all needed polyfills (e.g. traceur runtime and es6 module loader) need to be added to the scripts
array of the benchpress configuration file as well.
Closing.
from benchpress.
Related Issues (20)
- Runner should be more variable-aware
- Bug deploy npm version "0.1.2" HOT 2
- Add support for Chakra's window.CollectGarbage()
- improve UI for comparing steps
- before and after sample mode
- consider how to best run benchmarks on mobile HOT 1
- Get rid of build step
- lib/template.html - <title> HOT 1
- Consider using karma browser launchers in place of current CLI launch_chrome logic
- does not work when using with new `traceur-runtime.js` HOT 3
- remove traceur runtime requirement
- RAIL performance goals HOT 2
- Where are the Docs? HOT 2
- Understanding the Output?
- looser coupling between running and reporting UIs HOT 3
- Show version of script in UI
- min/max don't get updated when sample no longer contains value
- Allow async tests
- Show browser warnings at top of UI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from benchpress.