Whenever I write a lightspeedcode that has to traverse a lot of records (1 million+) and I use normal linq code I run out of memory. This happens because lightspeed caches the entities. My workaround is to detach each entitity as it is retrieved within the processing loop.
I know there are alternatives like writing a special query and map columns to propties myself. But that means more and ugly code imho.
I'd suggest a new codeword .Detached. like .WithIndexHint. and such which makes Ligthspeed;
Not only will this fix the memory ballooning, it might also speed things up considerably. All while being able to keep the code small, neat and readable.
Status: New
|