Comments on: EntityFramework Core vs Dapper https://code-maze.com/entityframeworkcore-vs-dapper/ Learn. Code. Succeed. Mon, 18 Dec 2023 08:42:48 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: Marinko Spasojević https://code-maze.com/entityframeworkcore-vs-dapper/#comment-8598 Tue, 18 Jul 2023 12:23:41 +0000 https://code-maze.com/?p=91746#comment-8598 In reply to Michal.

Hi Michal. Well, from my own perspective, the EF queries are the default without AsNoTracking, and we tried to show a comparison between the two default queries. By default EF Core is tracking changes and we didn’t do anything to improve a default Dapper query. Also, this article is not strictly about the performance of the two, the performance is just one of the differences, and again, as we stated, there are techniques that we can add to EF Core queries to improve the speed. I perfectly agree that applying AsNoTracking will speed up the query, and now, when I talk to you about it, I will probably run the test with AsNoTracking and post it in the article, because why not. If this will add a clearer picture of the performance differences between the two, I am more than happy to add that.

]]>
By: Michal https://code-maze.com/entityframeworkcore-vs-dapper/#comment-8597 Tue, 18 Jul 2023 12:13:22 +0000 https://code-maze.com/?p=91746#comment-8597 In reply to Marinko Spasojević.

I would argue that not applying AsNoTracking is a serious missconfiguration of your test. If you don’t add it the whole test is not fair. It is not an optimization technique, it’s just configuration of the data query.

If you want to compare the features between framework you should use the code equivalent between them. Only then the test is fair and make any sense.

]]>
By: Marinko Spasojević https://code-maze.com/entityframeworkcore-vs-dapper/#comment-8590 Mon, 17 Jul 2023 10:02:23 +0000 https://code-maze.com/?p=91746#comment-8590 In reply to Michal.

Hi Michal. You are correct, but please read the whole thing and you will see that we explicitly mentioned that. Like here: “That said, this is a simple example as there are many variables that can affect EF Core queries (as we already mentioned) and those results can be much faster.”, and also the section we are mentioning in the sentence I just quoted: “However, it offers several performance optimization techniques, including caching and change tracking, which can enhance overall performance.”

]]>
By: Michal https://code-maze.com/entityframeworkcore-vs-dapper/#comment-8589 Mon, 17 Jul 2023 09:55:44 +0000 https://code-maze.com/?p=91746#comment-8589 AsNoTracking is missing in EF core implementation. I am pretty sure adding it would reduce the difference significantly

]]>