Is the first persistance of an Entity Data Model in EF 4.0 slower due to the connection cost ?

Posted by Scott Davies on Stack Overflow See other posts from Stack Overflow or by Scott Davies
Published on 2010-04-09T15:31:26Z Indexed on 2010/04/09 15:33 UTC
Read the original article Hit count: 313

Hi,

I've got a console app written that persists an object graph via Entity Framework 4.0. I loop through this to dump the execution times for each persistance. The first persistance is always the largest. Is this due to EF making the initial connection to the database and/or JIT'ing ?

Here's a sample of the output:

Persisted graph in **3318** millseconds.
Persisted graph in 25 millseconds.
Persisted graph in 26 millseconds. 
Persisted graph in 22 millseconds.

Thanks,

Scott

© Stack Overflow or respective owner

Related posts about entity-framework-4

Related posts about benchmarking