<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : ImportEntities slowness</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : ImportEntities slowness</description>
  <pubDate>Tue, 21 Apr 2026 14:10:43 -700</pubDate>
  <lastBuildDate>Thu, 08 Jul 2010 19:47:11 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1939</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>ImportEntities slowness : We got it. Thanks! </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7574#7574</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1939<br /><strong>Posted:</strong> 08-Jul-2010 at 7:47pm<br /><br />We got it.&nbsp; Thanks!]]>
   </description>
   <pubDate>Thu, 08 Jul 2010 19:47:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7574#7574</guid>
  </item> 
  <item>
   <title>ImportEntities slowness : Thanks. I have submitted the solution...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7568#7568</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 1939<br /><strong>Posted:</strong> 08-Jul-2010 at 10:15am<br /><br />Thanks.&nbsp; I have submitted the solution on ticket #7159]]>
   </description>
   <pubDate>Thu, 08 Jul 2010 10:15:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7568#7568</guid>
  </item> 
  <item>
   <title>ImportEntities slowness : Wow, that&amp;#039;s not the code...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7558#7558</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1939<br /><strong>Posted:</strong> 07-Jul-2010 at 7:37pm<br /><br />Wow, that's not the code I was expecting.&nbsp; However, that shouldn't affect the timing on the second import.&nbsp; Do you have a small solution that you can send over to support so that we can look for anything that stands out?]]>
   </description>
   <pubDate>Wed, 07 Jul 2010 19:37:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7558#7558</guid>
  </item> 
  <item>
   <title>ImportEntities slowness : Not importing from offline storage,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7539#7539</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 1939<br /><strong>Posted:</strong> 06-Jul-2010 at 11:32pm<br /><br />Not importing from offline storage, just directly from the "fromManager".&nbsp; The entities in fromManager were queried for in standard ways.&nbsp; I tried this anyways:<br><br>var toManager = new DomainModelEntityManager(fromManager);<br>var entityList = new List&lt;Entity&gt;();<br>foreach (var propertyInfo in fromManager.GetType().GetProperties())<br>{<br>&nbsp; if (propertyInfo.PropertyType.BaseType == typeof(EntityQuery))<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; var entities = ((IEnumerable)fromManager.GetType().GetProperty(propertyInfo.Name).GetValue(fromManager, null)).Cast&lt;Entity&gt;().ToList();<br>&nbsp;&nbsp;&nbsp; entityList.AddRange(entities);<br>&nbsp; }<br>}<br><font color="#3300ff">Console.WriteLine("Importing " + entityList.Count() + " entities " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br></font>toManager.ImportEntities(entityList, MergeStrategy.OverwriteChanges);<br><font color="#3300ff">Console.WriteLine("Importing 2nd time " + entityList.Count() + " entities " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br></font>toManager.ImportEntities(entityList, MergeStrategy.OverwriteChanges);<br><font color="#3300ff">Console.WriteLine("Done " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br></font><b><br>Importing 2 entities 23:05:50:3062<br>Importing 2nd time 2 entities 23:05:52:3902<br>Done 23:05:53:9682<br></b><br><b>So, 2.08s first time, 1.58s second time.</b><br><br>Throwing in query gave the same timing results.<br><br>var toManager = new DomainModelEntityManager(fromManager);<br>var q = ((DomainModelEntityManager)toManager ).Customers.With(QueryStrategy.Normal);<br>q.ExecuteAsync(op =&gt;<br>{<br>&nbsp; var entityList = new List&lt;Entity&gt;();<br>&nbsp; foreach (var propertyInfo in fromManager.GetType().GetProperties())<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; if (propertyInfo.PropertyType.BaseType == typeof(EntityQuery))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var entities = ((IEnumerable)from.GetType().GetProperty(propertyInfo.Name).GetValue(from, null)).Cast&lt;Entity&gt;().ToList();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; entityList.AddRange(entities);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br>&nbsp; Console.WriteLine("Importing " + entityList.Count() + " entities " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br>&nbsp; toManager.ImportEntities(entityList, MergeStrategy.OverwriteChanges);<br>&nbsp; Console.WriteLine("Importing 2nd time " + entityList.Count() + " entities " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br>&nbsp; toManager.ImportEntities(entityList, MergeStrategy.OverwriteChanges);<br>&nbsp; Console.WriteLine("Done " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br>});<br><b><br>Importing 2 entities 23:29:41:5530<br>Importing 2nd time 2 entities 23:29:43:4812<br>Done 23:29:45:0553<br></b><br>]]>
   </description>
   <pubDate>Tue, 06 Jul 2010 23:32:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7539#7539</guid>
  </item> 
  <item>
   <title>ImportEntities slowness : We haven&amp;#039;t been able to reproduce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7536#7536</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1939<br /><strong>Posted:</strong> 06-Jul-2010 at 8:47pm<br /><br />We haven't been able to reproduce this on our end.&nbsp; My import takes 0.1 second.<DIV>&nbsp;</DIV><DIV>If you are loading the entities from offline storage as the first thing in an application, you could be measuring the initialization time of the Entity Framework.&nbsp; Try merging twice or performing a query before the merge to see if the timing is different.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 06 Jul 2010 20:47:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7536#7536</guid>
  </item> 
  <item>
   <title>ImportEntities slowness : It seems like ImportEntities is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7510#7510</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 1939<br /><strong>Posted:</strong> 03-Jul-2010 at 11:43am<br /><br />It seems like ImportEntities is very slow now.&nbsp; Regardless of importing 2 entities or 2000 entities to a new EntityManager, it takes around 2 seconds...<br><br>var toManager = new DomainModelEntityManager(fromManager);<br><font color="#339933">// magic happens here... build up a list of entities to copy into entityList.<br></font>Console.WriteLine("Importing " + entityList.Count() + " entities " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br>toManager.<font color="#6666cc">ImportEntities</font>(entityList, MergeStrategy.OverwriteChanges);<br>Console.WriteLine("Done " + DateTime.Now.ToString("HH:mm:ss:ffff"));<br><br>results:<br>Importing 2 entities 11:35:14:8009<br>Done 11:35:16:7471<br><br>Importing 2071 entities 11:35:26:7271<br>Done 11:35:28:9743<br><br>Any idea what I could look for that would cause this?<br><br>Thanks!<br><br>]]>
   </description>
   <pubDate>Sat, 03 Jul 2010 11:43:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1939&amp;PID=7510#7510</guid>
  </item> 
 </channel>
</rss>