Permalink
Browse files

Added haml.js to benchmarks

  • Loading branch information...
1 parent e68ae63 commit 50db8001d1aa475b7d79bc5c0b172ef6ff09a580 @tj tj committed Jun 27, 2010
Showing with 37 additions and 3 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 benchmarks/haml
  3. +23 −0 benchmarks/layout.haml
  4. +10 −3 benchmarks/run.js
View
3 .gitmodules
@@ -1,3 +1,6 @@
[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
1 benchmarks/haml
@@ -0,0 +1 @@
+Subproject commit 015e921327472a096717176a58842f8c1b845fb7
View
23 benchmarks/layout.haml
@@ -0,0 +1,23 @@
+!!!
+%html
+ %head
+ %title Jade
+ %body
+ %h1#title Jade rules
+
+ %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
View
13 benchmarks/run.js
@@ -6,13 +6,14 @@
var sys = require('sys'),
fs = require('fs'),
- jade = require('./../lib/jade');
+ jade = require('./../lib/jade'),
+ haml = require('./haml/lib/haml');
/**
* Iterations.
*/
-var times = 500;
+var times = 1000;
sys.puts('running ' + times + ' times.');
/**
@@ -36,9 +37,15 @@ function bm(label, fn) {
// Setup
var jadeStr = fs.readFileSync(__dirname + '/layout.jade', 'utf8');
+var hamlStr = fs.readFileSync(__dirname + '/layout.haml', 'utf8');
// Jade
bm('jade', function(){
jade.render(jadeStr);
-});
+});
+
+bm('haml.js', function(){
+ haml.render(hamlStr);
+});
+

0 comments on commit 50db800

Please sign in to comment.