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.
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.
My code looks like this:
var Parser = new TSql100Parser(true);
TextReader reader = new StringReader(sql);
IList<ParseError> errors;
var fragments = Parser.Parse(reader, out errors);
I've googled this and not found any complaints about speed so I'm wondering if I'm doing something wrong.