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,9 +0,0 @@
|
||||
library compiler_benchmark;
|
||||
|
||||
import './selector_benchmark.dart' as sbm;
|
||||
import './compiler_benchmark.dart' as cbm;
|
||||
|
||||
main () {
|
||||
sbm.main();
|
||||
cbm.main();
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Promise.all([
|
||||
System.import('benchmarks/compiler/selector_benchmark'),
|
||||
System.import('benchmarks/compiler/compiler_benchmark')
|
||||
]).then(function (benchmarks) {
|
||||
benchmarks.forEach(function(bm) {
|
||||
bm.main();
|
||||
});
|
||||
}, 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'}
|
||||
]
|
||||
});
|
||||
};
|
@ -1,7 +1,7 @@
|
||||
import {benchmark, benchmarkStep} from '../benchpress';
|
||||
import {benchmark, benchmarkStep} from 'benchpress/benchpress';
|
||||
|
||||
import {DOM, document} from 'facade/dom';
|
||||
import {isBlank} from 'facade/lang';
|
||||
import {isBlank, Type} from 'facade/lang';
|
||||
import {MapWrapper} from 'facade/collection';
|
||||
import {AnnotatedType} from 'core/compiler/annotated_type';
|
||||
|
||||
@ -61,7 +61,7 @@ function setup() {
|
||||
});
|
||||
|
||||
reflector.registerGetters({
|
||||
"inter0": (a) => a.inter0, "inter1": (a) => a.inter1,
|
||||
"inter0": (a) => a.inter0, "inter1": (a) => a.inter1,
|
||||
"inter2": (a) => a.inter2, "inter3": (a) => a.inter3, "inter4": (a) => a.inter4,
|
||||
|
||||
"value0": (a) => a.value0, "value1": (a) => a.value1,
|
||||
@ -111,7 +111,7 @@ export function main() {
|
||||
benchmark(`instantiate 5*${COUNT} element with bindings`, function() {
|
||||
var template = loadTemplate('templateWithBindings', COUNT);
|
||||
var protoView = compiler.compileWithCache(null, annotatedComponent, template);
|
||||
var rootRecordRange = new ProtoRecordRange().instantiate(null, new Object());
|
||||
var rootRecordRange = new ProtoRecordRange().instantiate(null, null);
|
||||
|
||||
benchmarkStep('run', function() {
|
||||
var view = protoView.instantiate(null, null, null);
|
||||
|
@ -1,3 +1,5 @@
|
||||
$SCRIPTS$
|
||||
|
||||
<template id="templateNoBindings">
|
||||
<div class="class0 class1 class2 class3 class4 " nodir0="" attr0="value0" nodir1="" attr1="value1" nodir2="" attr2="value2" nodir3="" attr3="value3" nodir4="" attr4="value4">
|
||||
<div class="class0 class1 class2 class3 class4 " nodir0="" attr0="value0" nodir1="" attr1="value1" nodir2="" attr2="value2" nodir3="" attr3="value3" nodir4="" attr4="value4">
|
||||
|
7
modules/benchmarks/src/compiler/main.js
Normal file
7
modules/benchmarks/src/compiler/main.js
Normal file
@ -0,0 +1,7 @@
|
||||
import * as sbm from './selector_benchmark';
|
||||
import * as cbm from './compiler_benchmark';
|
||||
|
||||
export function main() {
|
||||
sbm.main();
|
||||
cbm.main();
|
||||
}
|
@ -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);
|
@ -1,4 +1,4 @@
|
||||
import {benchmark, benchmarkStep} from '../benchpress';
|
||||
import {benchmark, benchmarkStep} from 'benchpress/benchpress';
|
||||
|
||||
import {SelectorMatcher} from "core/compiler/selector";
|
||||
import {CssSelector} from "core/compiler/selector";
|
||||
|
Reference in New Issue
Block a user