EFProf – Profiler Tool for Entity Framework
Join the DZone community and get the full member experience.Join For Free
one of the important tools in your tool arsenal when you develop with an orm tool is a profiler. like sql profiler to a sql server dba an entity framework profiler is a must have tool to entity framework developer.
the main reasons to acquire such a tool are to understand what is going on underneath the hood in the query engine and for performance tuning. if you think that you can use entity framework without knowing what it is committing to database then you should think again. things like select n+1 or avoiding too many joins will get back at you during runtime and kick you in the face.
it includes a very intuitive views/reports and supply a lot of valuable information about what is going on when you use entity framework . it also provides a lot of performance alerts which can lead you to find bottle necks or problems in writing the data access queries. behind the tool you can find oren eini ( ayende ) which is very known for his support for nhibernate and he brings tones of knowledge in the orms world to the tool.
how to get started with efprof
when you want to use efprof you first need to do the following things:
add reference to the
dll in your application.
the dll can be found in the tool folder.
in the application start you will call the following line of code:
- now start the profiler application and then run your application and get the profiler input.
easy as that.
using the tool
when you start the profiler you will get the following screen:
after i configured my test application and ran it i got the following screen with all the information i needed:
you can see the queries that i run at the bottom, application
statistic at the left menu and more important stuff which gives you very
crucial details about your running application. you can also get
analysis of your code in the left menu such as:
one feature that i really liked and made me feel like a dba was the ability to see the query plan of the query in a visual way:
and of course the ability to run your queries from the profiler:
the tool also supports alerts about common mistakes that you can do when you program against an orm.
profiling your application is a very important aspect for gaining
better performance and learning what you are doing in code when you use a
tool that you didn’t write. blind development without understanding
what is going inside a development tool is something that will get back
at you after deployment.
supply the insight on what is going on and is a very helpful tool to have.
as a last word, since efprof is a commercial tool this is my opinion that is expressed in this post and i wasn’t contact by hibernating rhinos .
Published at DZone with permission of Gil Fink, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Hiding Data in Cassandra
Implementing a Serverless DevOps Pipeline With AWS Lambda and CodePipeline
Alpha Testing Tutorial: A Comprehensive Guide With Best Practices
Comparing Cloud Hosting vs. Self Hosting