This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (factory, broccoli) { | |
var UglifyJSFilter = require('broccoli-uglify-js')(broccoli) | |
var ES6ConcatenatorCompiler = require('broccoli-es6-concatenator')(broccoli) | |
var StaticCompiler = require('broccoli-static-compiler')(broccoli) | |
var featuresJSON = JSON.parse(fs.readFileSync('features.json', { encoding: 'ascii' }})) | |
var devDefeaturifyFilter = new DefeaturifyFilter({ | |
features: featuresJSON.features, | |
debugStatements: features.debugStatements | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (factory, broccoli) { | |
var UglifyJSFilter = require('broccoli-uglify-js')(broccoli) | |
var ES6ConcatenatorCompiler = require('broccoli-es6-concatenator')(broccoli) | |
var StaticCompiler = require('broccoli-static-compiler')(broccoli) | |
// Should we really rely on cwd to read features.json? | |
var featuresJSON = JSON.parse(fs.readFileSync('features.json', { encoding: 'ascii' }})) | |
var devDefeaturifyFilter = new DefeaturifyFilter({ | |
features: featuresJSON.features, | |
debugStatements: features.debugStatements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// `walkSync(baseDir)` is a faster substitute for | |
// glob.sync('**', { | |
// cwd: baseDir, | |
// dot: true, | |
// mark: true, | |
// strict: true | |
// }) | |
// | |
// `baseDir` must not be ''; pass '.' instead | |
exports.walkSync = walkSync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~3607 bytes min.gz overhead from these kinds of declarations: | |
define('somemod', ... | |
... | |
var rewatch = __dependency6__.rewatch; <------------- | |
var finishChains = __dependency7__.finishChains; <------------- | |
... | |
There are 793 such lines, thus adding about 4.5 bytes in .min.gz size each. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
( | |
echo "(function() {" | |
for i in {0..9999}; do | |
echo " | |
var var$i = 1 | |
var read$i = function() { | |
// Prevent inlining by feigning recursion | |
if (!var$i) read$i() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var outerVars = 10000 | |
var iterations = 100000 | |
src = '' | |
src += '(function() {' | |
for (var i = 0; i < outerVars / 3; i++) { | |
src += ' var num' + i + ' = 1\n' | |
src += ' var read' + i + ' = function() {\n' | |
// Prevent inlining by feigning recursion | |
src += ' if (!num' + i + ') read' + i + '()\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var fs = require('fs') | |
var rimraf = require('rimraf') | |
fs.mkdirSync('x') | |
var string = '' | |
for (var i = 0; i < 100; i++) { | |
string += '1234567890' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
*= require jquery | |
*= require underscore | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs.mkdirSync('testdir') | |
var obj = { | |
'foo.txt': 'foo.txt contents', | |
'subdir': { | |
'bar.txt': 'bar.txt contents', | |
} | |
} | |
writeSync('testdir', obj) // write foo.txt and subdir/bar.txt to disk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[broccoli-filter] Copy time in TranspilerFilter: 23ms | |
[broccoli-filter] Copy time in TranspilerFilter: 111ms <-------- | |
Slowest Trees | Total | |
-------------------------------+---------------- | |
TranspilerFilter | 204ms <--------- probably this one - 50%? | |
Concat | 117ms | |
TreeMerger | 114ms | |
TreeMerger | 105ms |
OlderNewer