|
Hello CamlEx Team,
First, I need to say I LOVE this tool ! :) What a great idea to leave CAML heavy syntax away and give developpers more time on essential tasks ! :) It's like when Linq2Sql or Entity Frwk was coming, I was happy to be able to just forget SQL syntax ! :)
BUT, I've done some performance check, comparing CamlEx runtime query generation against string.Format() query composition and you probably guess that string formating is 10 , maybe 100 times faster ! :( (I've done simple testing with basic query likes the
ones you show on te camlex home page. I can gives you the code I use to make my tests. Sometimes the query generation make same time than the query execution time on my sharepoint)
Do you have some plan to integrate something like compiled query to be able to not compute the integral expression tree each time I want the "same" caml query but with different parameter ?
i.e. : with this sample from yours :
// list of tokens
var tokens = new List<string> { "hello", "greeting", "hi" };
var expressions = new List<Expression<Func<SPListItem, bool>>>();
// create lambda expression for each token in list
foreach (string t in tokens)
{
string token = t;
expressions.Add(x => ((string)x["Title"]).Contains(token));
}
// prepare query
var caml = Camlex.Query().WhereAny(expressions).ToString();
Each time I need to execute this request but with differents tokens, The "generation" time is the same.But maybe It will be possible to generate the request with some {xx} token, replaceable next time with a simple string.format for other tokens.Then I can
put this "compiled" query into static variale to reuse next time where I need the same query with same number of input parameters....
Not sure to be clear :) Not sure to have the good idea for better performance :) but I will happy if you have plan for that or maybe if I can help for that !
|