cinema6/twobits.js — pull request #1 by minznerjosh (2014-05-27 20:49:05+00:00)
Title: Optimize For Speed! 

to @sqmunson

If you haven't met the DOM templating library I built yet, say hello to TwoBits.js!

TwoBits templates should feel very familiar:

```html

Hello {{name}}!

```

And now lets compile it:
```javascript
var data = {
name: 'Scott'
};

var compile = tb.parse(document.documentElement);

compile(data);
```

That ```

``` will now contain: ```Hello Scott!```.

This PR changes the parse/compile steps so that all of the search/replacing is done in the parse step, leaving the compile step to be only concatenation and DOM modification. The reasoning behind this is that parsing should only happen **once** when the page loads (so it can be slower), but compiling could happen **many** times after the page loads (to update the DOM with the latest data, so it should be faster.)