andrewdavey/cassette — Issue #144: LessCompiler slowing down startup 
Author: honestegg
Created: 2012-01-23 17:26:48+00:00
State: open

It appears that the LessCompiler is slowing down the application startup even when there are no .LESS files to compile. During development, if we make any small change to a page it will then take 30 to 60 seconds to reload the that page.

Setting up the Jurassic ScriptEngine in the constructor seems to be an expensive operation. This happens whether there are any .LESS files to process or not.

```c#
public LessCompiler()
{
engine = new ScriptEngine();
engine.Execute("window = { location: { href: '/', protocol: 'http:', host: 'localhost' } };");
engine.SetGlobalFunction("xhr", new Action(Xhr));
engine.Execute(Properties.Resources.less);
}
```

Would it be better to only setup the ScriptEngine the first time it is used? -- Maybe move this out of the constructor and into the "get" of a property?