- helpers.copyPreserveSync (would need API change to do symlinks instead; possibly still optimizable without symlinks)
- walkSync
- helpers.hashTree (note: also duplicates stat calls with walkSync)
- mkdir/mkdirp (probably unnecessary calls here)
- rimraf via quick-temp via broccoli-writer (new API would move this from writer into core, but rimraf call is still necessary)
- perhaps some suprising CPU sinks, like hashing crypto, path module, etc.
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
// === Identifier rewriting for the ES6 module transpiler === | |
// Proposal for minifier-friendly ES6 module transpiler output. | |
// This is for cases where we don't require any existing module | |
// format (AMD, CommonJS) and just want to emit a blackbox IIFE | |
// that uses modules internally. Those cases are Ember's normal | |
// global distribution (ember.min.js), as well as ES5 generated | |
// by the upcoming ember-cli ES6 stack. | |
// Do you all think this could work? |
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 |
Breaking down what merge-trees spends time on, on a set of 500 small files:
walkSync 6 ms
pathManipulation 7 ms <------- string stuff, doesn't hit file system
mkdir 1 ms
copy 71 ms <------- clearly unacceptable, and gets much worse with big image files
mergeTotal 86 ms