locked
EF with code first way to handle 2000 tables, how to improve performance? I found that very poor performance RRS feed

  • Question

  • EF  with code first way to handle 2000 tables(include 2000 DbSets in DbContext), how to improve performance? I found that very poor performance For CRUD
    Thursday, August 11, 2011 5:08 AM

Answers

  • Hi unreal02,

    Welcome!

    Here is the performance consideration in EF4, but the same with EF4.1 Code First.

    There is a Power Tool here for Code First(pre-complied views).

    This may result in better performance when querying for large numbers of entities in read-only scenarios. A new extension method AsNoTracking allows any query to be run in this way.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Alan_chen Thursday, September 1, 2011 6:19 AM
    Friday, August 12, 2011 6:47 AM

All replies

  • Hi unreal02,

    Welcome!

    Here is the performance consideration in EF4, but the same with EF4.1 Code First.

    There is a Power Tool here for Code First(pre-complied views).

    This may result in better performance when querying for large numbers of entities in read-only scenarios. A new extension method AsNoTracking allows any query to be run in this way.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Alan_chen Thursday, September 1, 2011 6:19 AM
    Friday, August 12, 2011 6:47 AM
  • I have already pre-compiled it,Performance has improved, But there is still some serious delays.

    others,

    how to opening the database connection manually in DbContext

    Sunday, August 14, 2011 2:20 PM
  • Hi unreal02,

    Thanks for your feedback.

    I think you can use Context.Database.Connection.Open() method.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 15, 2011 8:37 AM
  • Hi,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

    Have a nice day. 


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 17, 2011 1:06 PM
  • hi,Alan_chen

    I found in accordance with the above Suggestions, increased performance is limited. I want to split into different context according to modules, I think that the effect will be very good. In this aspect, can have any Suggestions?

    Monday, August 22, 2011 7:05 AM
  • Hi,

    Here is a good blog to describe this scenario, you can refer here.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 24, 2011 6:15 AM
  • Hi,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

    Have a nice day.

     


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 26, 2011 3:06 AM