r/ASPNET • u/nunofgs • Jun 26 '11
This project has saved me countless hours. Mentlegen, I give you Linq.Autocompiler
http://linqautocompiler.codeplex.com/
11
Upvotes
r/ASPNET • u/nunofgs • Jun 26 '11
View all comments
Show parent comment
3
u/nunofgs Jun 27 '11 edited Jun 27 '11
I don't have actual benchmarks for you, but others have done the work for me.
As for my own experience, I am developing a custom synchronization application between two decently-sized databases and need to run some custom code when a few tables get sent to the other side.
I was doing around 20 queries and 2 inserts for each database row that was sent. In my very specific case, it was taking over 3 hours for a table with 6000-ish rows.
When I figured out that I needed to use compiled queries, I found linq.autocompiler... so instead of refactoring all my queries into static methods (which you have to do if you're using the regular compiled queries), I simply added ".AsCompilable()" to all of my queries. Took me all of 5 minutes.
The performance difference is amazing. The same database synchronization took under 3 minutes to perform.
Granted, if you're doing a small application with a very sporadic linq query, you might not need linq.autocompiler, but then again it's as easy as adding the assembly to your project and appending ".AsCompilable()" to your query... so why not?
EDIT: I have absolutely no ties to this software. It is simply a wonderful piece of software that I found online that I believe every developer should know about, if they're using linq.