Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Performance issues

$
0
0

Hi Arthur,

Thanks for your reply. We are inserting one row at a time in a loop, the loop is in a function which is called from many threads. 

This is the NHibernate code

 while (!_isDone)                {                 using (var session = _sessionFactory.OpenSession ())                 {                     using (var transaction = session.BeginTransaction ())                     {                         var qrow = new row ()                         {                             ThreadId = qthread_id,                             Text = qtext,                             Timestamp = qnow,                             Secs = qnow.Millisecond,                         };                         session.SaveOrUpdate (qrow);                         transaction.Commit ();                         }                     }                }

 

 

This is the EF6 code

  while (!_isDone)             {                 using (entities qdb = new entities ())                 {                     var qrow = new row()                     {                         ThreadId = qthread_id,                         Text = qtext,                         Timestamp = qnow,                         Secs = qnow.Millisecond,                     };                     qdb.Loads.Add (qrow);                     qdb.SaveChanges ();                 }             }

We noticed a minor difference in the sql that is generated by NHibernate and EF6 (EF6 selects the RowCount).

Please let us know if we should do something different.

 

Thanks,

 

Mahesh Menghani @ axceler 

 


Viewing all articles
Browse latest Browse all 1793

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>