Menu

1 / 2

EF Core vs redb: an object graph against 54 tables and Include

DEV Community: dotnet·rinat kozin·11 days ago
#cQ87cRFn
#devtodotnet#devto#dev#redb#object
Reading 0:00
15s threshold

An employee with addresses, contacts and dictionaries: 54 tables and 31 Include calls in EF Core, one class in redb Pro. Measured on 100k objects: who wins where

One employee from our examples takes 62 SQL queries and almost two seconds to read in EF Core. In redb Pro the same employee, from the same data and in the same shape, takes 131 ms and nine queries, and 36 ms and five on the repeat run. The difference is not that one engine is "fast" and the other "slow". It is how many tables have to be put back together to get one business object out of the database.

Below: what exactly we compared, why a graph is expensive in normal form, how redb Pro learned to read it without folding everything, and where EF Core is simply faster. There are quite a few such places, and they are in the tables too.

The object under test

Every measurement uses one model from the examples project.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.