refactor(build): simplify and modularize
simplify: - use same html file for dart and JS - build benchmarks automatically when doing `gulp build` - centralize configuration modularize: - move all build tasks into separate node.js modules under `tools/build`. changes: - the `build` folder is now the `dist` folder Closes #284
This commit is contained in:
@ -1,11 +0,0 @@
|
||||
library injector_get_benchmark;
|
||||
|
||||
import './injector_instantiate_benchmark.dart' as b;
|
||||
import 'dart:js' as js;
|
||||
|
||||
main () {
|
||||
js.context['benchmarkSteps'].add(new js.JsObject.jsify({
|
||||
"name": "Injector.instantiate",
|
||||
"fn": new js.JsFunction.withThis((_) => b.run())
|
||||
}));
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
System.import('benchmarks/di/injector_get_benchmark').then(function (bm) {
|
||||
window.benchmarkSteps.push({name: 'Injector.get (token)', fn: bm.run});
|
||||
}, console.log.bind(console));
|
||||
|
||||
System.import('benchmarks/di/injector_get_by_key_benchmark').then(function (bm) {
|
||||
window.benchmarkSteps.push({name: 'Injector.get (key)', fn: bm.run});
|
||||
}, console.log.bind(console));
|
||||
|
||||
System.import('benchmarks/di/injector_get_child_benchmark').then(function (bm) {
|
||||
window.benchmarkSteps.push({name: 'Injector.get (grand x 5 child)', fn: bm.run});
|
||||
}, console.log.bind(console));
|
||||
|
||||
System.import('benchmarks/di/injector_instantiate_benchmark').then(function (bm) {
|
||||
window.benchmarkSteps.push({name: 'Injector.instantiate', fn: bm.run});
|
||||
}, console.log.bind(console));
|
@ -1,11 +0,0 @@
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
scripts: [
|
||||
{src: '/js/traceur-runtime.js'},
|
||||
{src: '/js/es6-module-loader-sans-promises.src.js'},
|
||||
{src: '/js/extension-register.js'},
|
||||
{src: 'register_system.js'},
|
||||
{src: 'benchmark.js'}
|
||||
]
|
||||
});
|
||||
};
|
@ -0,0 +1 @@
|
||||
$SCRIPTS$
|
24
modules/benchmarks/src/di/main.js
Normal file
24
modules/benchmarks/src/di/main.js
Normal file
@ -0,0 +1,24 @@
|
||||
import * as injector_get_benchmark from './injector_get_benchmark';
|
||||
import * as injector_get_by_key_benchmark from './injector_get_by_key_benchmark';
|
||||
import * as injector_get_child_benchmark from './injector_get_child_benchmark';
|
||||
import * as injector_instantiate_benchmark from './injector_instantiate_benchmark';
|
||||
|
||||
import {benchmark, benchmarkStep} from 'benchpress/benchpress';
|
||||
|
||||
export function main() {
|
||||
benchmark(`Injector.get (token)`, function() {
|
||||
benchmarkStep('run', injector_get_benchmark.run);
|
||||
});
|
||||
|
||||
benchmark(`Injector.get (key)`, function() {
|
||||
benchmarkStep('run', injector_get_by_key_benchmark.run);
|
||||
});
|
||||
|
||||
benchmark(`Injector.get (grand x 5 child)`, function() {
|
||||
benchmarkStep('run', injector_get_child_benchmark.run);
|
||||
});
|
||||
|
||||
benchmark(`Injector.instantiate`, function() {
|
||||
benchmarkStep('run', injector_instantiate_benchmark.run);
|
||||
});
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
System.paths = {
|
||||
'core/*': '/js/core/lib/*.js',
|
||||
'change_detection/*': '/js/change_detection/lib/*.js',
|
||||
'facade/*': '/js/facade/lib/*.js',
|
||||
'di/*': '/js/di/lib/*.js',
|
||||
'rtts_assert/*': '/js/rtts_assert/lib/*.js',
|
||||
'test_lib/*': '/js/test_lib/lib/*.js',
|
||||
'benchmarks/*': '/js/benchmarks/lib/*.js',
|
||||
'reflection/*': '/js/reflection/lib/*.js'
|
||||
};
|
||||
register(System);
|
Reference in New Issue
Block a user