From eb62e7490c8a68874d60c761d4f06c41b620fc53 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 30 Jun 2010 21:09:11 -0700 Subject: [PATCH] Removed benchmarks --- .gitmodules | 8 +---- Makefile | 5 +--- benchmark/haml | 1 - benchmark/haml-js | 1 - benchmark/layout.haml | 23 -------------- benchmark/layout.jade | 23 -------------- benchmark/run.js | 70 ------------------------------------------- 7 files changed, 2 insertions(+), 129 deletions(-) delete mode 160000 benchmark/haml delete mode 160000 benchmark/haml-js delete mode 100644 benchmark/layout.haml delete mode 100644 benchmark/layout.jade delete mode 100755 benchmark/run.js diff --git a/.gitmodules b/.gitmodules index 5dc87d5bd..70f40a7a2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ [submodule "support/expresso"] path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "benchmarks/haml"] - path = benchmarks/haml - url = git://github.com/visionmedia/haml.js.git -[submodule "benchmark/haml-js"] - path = benchmark/haml-js - url = http://github.com/creationix/haml-js.git + url = git://github.com/visionmedia/expresso.git \ No newline at end of file diff --git a/Makefile b/Makefile index 9a05b5fad..820e64218 100644 --- a/Makefile +++ b/Makefile @@ -5,12 +5,9 @@ test: test-cov: @./support/expresso/bin/expresso -I lib --cov test/*.js -benchmark: - @./benchmark/run.js - api.html: lib/jade.js @dox --title "Jade" \ --desc "Jade is a high performance template engine for [node](http://nodejs.org), inspired by [haml](http://haml-lang.com/), created by [TJ Holowaychuk](http://github.com/visionmedia)." \ $< > $@ -.PHONY: test test-cov example benchmark \ No newline at end of file +.PHONY: test test-cov example \ No newline at end of file diff --git a/benchmark/haml b/benchmark/haml deleted file mode 160000 index 015e92132..000000000 --- a/benchmark/haml +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 015e921327472a096717176a58842f8c1b845fb7 diff --git a/benchmark/haml-js b/benchmark/haml-js deleted file mode 160000 index 34fb092db..000000000 --- a/benchmark/haml-js +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 34fb092db3fff6d3b95a361dea4c21b63b8553c9 diff --git a/benchmark/layout.haml b/benchmark/layout.haml deleted file mode 100644 index 5f10d4430..000000000 --- a/benchmark/layout.haml +++ /dev/null @@ -1,23 +0,0 @@ -!!! -%html - %head - %title Jade - %body - %h1#title= title - - %ul - %li.first a - %li b - %li - %ul.first.middle c - %ul d - %ul.last.middle e - %li.last f - - %p - just a regular paragraph - nothing to special - to see here... - - %a{ href: "/" } Home - %a{ href: "/blog"} Blog \ No newline at end of file diff --git a/benchmark/layout.jade b/benchmark/layout.jade deleted file mode 100644 index a71ba670a..000000000 --- a/benchmark/layout.jade +++ /dev/null @@ -1,23 +0,0 @@ -!!! -html - head - title Jade - body - h1#title= title - - ul - li.first a - li b - li - ul.first.middle c - ul d - ul.last.middle e - li.last f - - p - | just a regular paragraph - | nothing to special - | to see here... - - a(href="/") Home - a(href="/blog") Blog \ No newline at end of file diff --git a/benchmark/run.js b/benchmark/run.js deleted file mode 100755 index 78d512345..000000000 --- a/benchmark/run.js +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var sys = require('sys'), - fs = require('fs'), - jade = require('./../lib/jade'), - haml = require('./haml/lib/haml'), - hamljs = require('./haml-js/lib/haml'); - -/** - * Iterations. - */ - -var times = 500; -sys.puts('running ' + times + ' times.'); - -/** - * Run benchmarks, - * - * @param {String} label - * @param {Function} fn - */ - -function bm(label, fn) { - var n = times, - start = +new Date, - dotAt = times / 10; - while (n--) { - if (n % dotAt === 0) sys.print('.'); - fn(); - } - sys.puts(' ' + label + ': \x1b[32m' + (+new Date - start) + '\x1b[0m ms'); -} - -// Setup - -var jadeStr = fs.readFileSync(__dirname + '/layout.jade', 'utf8'); -var hamlStr = fs.readFileSync(__dirname + '/layout.haml', 'utf8'); - -// Benchmarks - -bm('jade render', function(){ - jade.render(jadeStr, { locals: { title: 'Jade' }}); -}); - -bm('haml.js render', function(){ - haml.render(hamlStr, { locals: { title: 'Haml' }}); -}); - -bm('haml-js render', function(){ - hamljs.render(hamlStr, { locals: { title: 'Haml' }}); -}); - -bm('jade cached', function(){ - jade.render(jadeStr, { cache: true, filename: 'layout.jade', locals: { title: 'Jade' }}); -}); - -bm('haml.js cached', function(){ - haml.render(hamlStr, { cache: true, filename: 'layout.haml', locals: { title: 'Haml' }}); -}); - -var js = hamljs.compile(hamlStr); -bm('haml-js cached', function(){ - hamljs.execute(js, null, { title: 'Haml' }); -}); - -