mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
slight reformats to cake bench
This commit is contained in:
4
Cakefile
4
Cakefile
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user