c# - Entity framework performance slow -
we using ef 6.0, .net 4.5 , using code first approach , our database has around 170 entities(tables) , main table holding around 150,000 records on first load of entity framework takes around 25 seconds. trying improve time slow , number of records increases becomes slower. have tried generating native images, tried using pre generated interactive views couldn't achieve significant improvements.
can please me on this?
thanks.
you can consider entity framework pre-generated mapping views.you can use ef power tools create pre-generate views.
using pre-generated views moves cost of view generation model loading (run time) compile time. while improves startup performance @ runtime, still experience pain of view generation while developing. there several additional tricks can reduce cost of view generation, both @ compile time , run time.
you can refer knowing more : entity framework pre-generated mapping views
you can use caching in entity framework improve performance of app.
there 3 types of caching.
1. object caching – objectstatemanager built objectcontext instance keeps track in memory of objects have been retrieved using instance. known first-level cache.
2. query plan caching - reusing generated store command when query executed more once.
3. metadata caching - sharing metadata model across different connections same model.
you can refer article read more : performance considerations ef 6
Comments
Post a Comment