Sunday, 15 June 2014

c# - Performance: Local vs database - Entity Framework -



c# - Performance: Local vs database - Entity Framework -

i have looked around simple reply |i haven't found (though if beingness blind or impatient, happy post me link)

i have next code in repository

get { if (context.entity.local.count == 0) { homecoming context.entity; } homecoming context.entity.local; }

i know mutual sense word local not querying database , getting result set memory. however, know is, how much faster fetching result set local database? huge difference?

i asking speed web application trying find weaknesses in code.

thanks

first, mutual sense makes no sense @ all. local nil defined @ in ef depends on whoever made repository , refer else.

second - lot. factor of 1000. database separate process, involves generating , parsing sql. 2x network transfer (or network alyer transfer). compare reading out property. 1000 conservative. not may lot of time in database start with.

it depends on - caching in memory , avoiding database valid strategy can create lot of difference, performance wise. @ cost of more memory consumption , alter synchronization issues. later not relevant (never changing) data.

c# asp.net-mvc entity-framework

No comments:

Post a Comment