Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> "LINQ on Speed"..faster LINQ and Live views
 

Pages: 1
LLBLGen Pro Runtime Framework
"LINQ on Speed"..faster LINQ and Live views
Page:1/1 

  Print all messages in this thread  
Poster Message
omar
User



Location:
Salmiya, Kuwait
Joined on:
15-Oct-2004 15:44:57
Posted:
569 posts
# Posted on: 14-Dec-2009 08:52:34.  
I came across this library

http://www.componentone.com/SuperProducts/LiveLinq/?gclid=CMv1vMCg1J4CFUYA4wodvXWWqg

and wondered if the benefits its promising are applicable to LINQ to LLBL?
We don't know who we are until we see what we can do  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37796 posts
# Posted on: 14-Dec-2009 10:27:38.  
I think it's for in-memory objects. So you can have indexed collections which you use inside linq queries over objects instead of lists, which are enumerated.

In v3, you'll get our library Algorithmia with a KeyedCommandifiedList, which has the same feature, and you can also use HashSet<T> today which often gives a lot of performance enhancements. So if you for example have a query like:
var q = from c in someEnumerable
            where c.Country=="USA"
            select c;

and you then want to filter another enumerable with the contents of q, you could do:
var q2 = from c in someOtherEnumerable
             where q.Contains(c) || c.SomeField==someVariable
             select c;

however, that's slow, as q is enumerated for every c in q2. So instead do:
var set = new HashSet<TypeOfElementIn_q>(q);
var q2 = from c in someOtherEnumerable
             where set.Contains(c) || c.SomeField==someVariable
             select c;

and you'll get better performance as set.Contains() is an O(1) operation instead of an O(n) Regular Smiley

On databases, it makes no sense to use indexed collections as the query is converted to a sql query.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.