Skip to content
This repository
Browse code

Added haml.js to benchmarks

  • Loading branch information...
commit 50db8001d1aa475b7d79bc5c0b172ef6ff09a580 1 parent e68ae63
TJ Holowaychuk authored
3  .gitmodules
... ... @@ -1,3 +1,6 @@
1 1 [submodule "support/expresso"]
2 2 path = support/expresso
3 3 url = git://github.com/visionmedia/expresso.git
  4 +[submodule "benchmarks/haml"]
  5 + path = benchmarks/haml
  6 + url = git://github.com/visionmedia/haml.js.git
1  benchmarks/haml
... ... @@ -0,0 +1 @@
  1 +Subproject commit 015e921327472a096717176a58842f8c1b845fb7
23 benchmarks/layout.haml
... ... @@ -0,0 +1,23 @@
  1 +!!!
  2 +%html
  3 + %head
  4 + %title Jade
  5 + %body
  6 + %h1#title Jade rules
  7 +
  8 + %ul
  9 + %li.first a
  10 + %li b
  11 + %li
  12 + %ul.first.middle c
  13 + %ul d
  14 + %ul.last.middle e
  15 + %li.last f
  16 +
  17 + %p
  18 + just a regular paragraph
  19 + nothing to special
  20 + to see here...
  21 +
  22 + %a{ href: "/" } Home
  23 + %a{ href: "/blog"} Blog
13 benchmarks/run.js
@@ -6,13 +6,14 @@
6 6
7 7 var sys = require('sys'),
8 8 fs = require('fs'),
9   - jade = require('./../lib/jade');
  9 + jade = require('./../lib/jade'),
  10 + haml = require('./haml/lib/haml');
10 11
11 12 /**
12 13 * Iterations.
13 14 */
14 15
15   -var times = 500;
  16 +var times = 1000;
16 17 sys.puts('running ' + times + ' times.');
17 18
18 19 /**
@@ -36,9 +37,15 @@ function bm(label, fn) {
36 37 // Setup
37 38
38 39 var jadeStr = fs.readFileSync(__dirname + '/layout.jade', 'utf8');
  40 +var hamlStr = fs.readFileSync(__dirname + '/layout.haml', 'utf8');
39 41
40 42 // Jade
41 43
42 44 bm('jade', function(){
43 45 jade.render(jadeStr);
44   -});
  46 +});
  47 +
  48 +bm('haml.js', function(){
  49 + haml.render(hamlStr);
  50 +});
  51 +

0 comments on commit 50db800

Please sign in to comment.
Something went wrong with that request. Please try again.