slight reformats to cake bench

This commit is contained in:
Jeremy Ashkenas
2010-11-20 20:28:45 -05:00
parent 2f498162b0
commit 835244f92d

View File

@@ -124,7 +124,7 @@ task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', ->
task 'bench', 'quick benchmark of compilation time', ->
{Rewriter} = require './lib/rewriter'
co = sources.map((name) -> fs.readFileSync name).join '\n'
fmt = (ms) -> " : #{bold}#{ " #{ms}".slice -4 }#{reset}[ms]"
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
total = 0
now = Date.now()
time = -> total += ms = -(now - now = Date.now()); fmt ms
@@ -136,7 +136,7 @@ task 'bench', 'quick benchmark of compilation time', ->
console.log "Parse #{time()}"
js = nodes.compile bare: true
console.log "Compile#{time()} (#{js.length} chars)"
console.log "TOTAL #{ fmt total }"
console.log "total #{ fmt total }"
task 'loc', 'count the lines of source code in the CoffeeScript compiler', ->
exec "cat #{ sources.join(' ') } | grep -v '^\\( *#\\|\\s*$\\)' | wc -l | tr -s ' '", (err, stdout) ->