title: Speed of Microsoft.Data.Schema.ScriptDom Parser
body: <p>I'm using the Microsoft.Data.Schema.ScriptDom and Microsoft.Data.Schema.ScriptDom.Sql libraries to parse SQL and add "TOP #" to SQL select statements. We do this to limit the result set in certain situations.  </p>
  
  <p>I just getting started using the library and I've noticed that parsing the SQL is not exactly fast. I've not instrumented the code to actually measure the speed but it is noticeable, between half to a whole second. Which is not terrible but I would not call it fast either. </p>
  
  <p>My code looks like this:</p>
  
  <pre><code>  var Parser = new TSql100Parser(true);      
    TextReader reader = new StringReader(sql);
    IList&lt;ParseError&gt; errors;
    var fragments = Parser.Parse(reader, out errors);
  </code></pre>
  
  <p>I've googled this and not found any complaints about speed so I'm wondering if I'm doing something wrong.</p>