I`m thinking of using POCO instead of automatically generating the entities, cause i don’t want any dependency on the framework
i was wondering if that will have any performance hit, I`m not sure if having to dynamically proxy my entities at run-time will affect performance ,
also i wonder if it gonna be faster if i just let EF4 generate the model for me.
I care about performance a lot in my current project and I have read many times about how L2S is slightly faster than EF2 but I’m not sure about EF4, so now I wonder if I will have performance issues by using EF4 instead of Linq2SQL.
I really wanna use POCO; that is why I prefer EF4 but then again I don’t wanna have performance issues.
EF4 and Ling2SQL are the only options for me because I can’t use native ADO.net or any other ORM, so can you please share your experience about EF4 and Linq2SQL from a performance perspective?
thanks in advance.
Recently, ADO.NET team releases the EF Power Tools to support code first development, which automatically generates POCOs from you model/database(mssql only), and could completely separate POCOs from other meta classes to give structure information of database tables.
At ADO.NET team blog, using EF Proxies is mentioned as following
When creating instances of POCO entity types, the Entity Framework often creates instances of a dynamically generated derived type that acts as a proxy for the entity. This proxy overrides some virtual properties of the entity to insert hooks for performing actions automatically when the property is accessed.Sometimes disabling proxy creation is useful to prevent the Entity Framework from creating proxy instances. For example, serializing non-proxy instances is considerably easier than serializing proxy instances. Proxy creation can be turned off by clearing the ProxyCreationEnabled flag.Of course, creating proxy would be not good at performance, but as mentioned above, it just overrides some virtual properties for loading relative properties so that I think creating proxy objects instead of POCOs is not a problem.