Inital Commit
[oweals/finalsclub.git] / node_modules / jade / benchmarks / haml.js
1
2 /**
3  * Module dependencies.
4  */
5
6 var bm = require('./common'),
7     haml = require('./haml-js/lib/haml'),
8     fs = require('fs');
9
10 var str = fs.readFileSync(__dirname + '/example.haml', 'ascii');
11
12 var n = bm.times;
13 bm.start('haml-js compilation');
14 while (n--) {
15     haml(str);
16 }
17 bm.stop();
18
19 var n = bm.times;
20 var fn = haml(str);
21 bm.start('haml-js execution');
22 while (n--) {
23     fn.call('whatever scope', bm.locals);
24 }
25 bm.stop();