Stored Procedures with Entity Framework - Performance Benchmark
Object-relational mapping (ORM) frameworks are crucial part of the application. No one wants to write the raw queries and working with raw data anymore. Recently I got a chance to perform some performance tests between Entity Framework (EF 6) regular approach and calling stored procedure using EF. The test was very simple and results were surprising. Just assume we have some web application and we are doing logging for each request (request time, IP, user etc.) in database using EF. There is a logging table in the database with the name RequestLogging and it has following columns (just for demonstration purpose): Id (int - Identity) RequestTime (datetime) OperationId (int) [Foreign key from Operation table] IpAddress (varchar(20)) UserId (int) [Foreign key from User table] RequestStatus (char(1)) [S - succes and F - failed] The Test Environment The test application is very simple. It ha...