Test Results
Every example on every platform, side by side with EF Core
How it was measured
- The examples are the redb.Examples project: every example runs on redb Pro over PostgreSQL, SQL Server and SQLite.
- EF Core runs a twin of each example on the same data, deployed into a flat relational model by redb.CLI (releases). The flat model has no nested JSON: the tables are in normal form.
- A head-to-head comparison: the same task on the same data, with the full object graph. EF Core got indexes of its own; on both sides the indexes are created after seeding.
- The data is seeded by example E203.
- Only the Pro edition of redb was measured.
- Settings that differ from the defaults, all visible in the examples' Program.cs:
SQLite maps the database file into memory (mmap up to 4 GB) and keeps a 64 MB page cache per connection instead of the default 2 MB;
PostgreSQL runs with JIT off (
jit=off), the same for redb and EF Core; redb saves with ChangeTracking instead of the default DeleteInsert, and its props cache works only in the "With props cache" run; EF Core gets a new context from a factory for every unit of work, as EF recommends.
The figures show the order of magnitude, not a guarantee: on other hardware and data the numbers will differ from our run. Anyone can repeat it, the examples and redb.CLI are open.
Real applications run other queries. Here every example works with the full object graph, and in some places EF Core will do better. redb has its own extra indexes and query tuning too: it is plain SQL throughout, no JSON.
First run with default settings, setup examples included.
Median time
108 examples finished by every platform, fastest first
Average time
Same examples; the average follows the heavy ones
Seeding speed
Example E203, objects per second on average; higher is better
Time in milliseconds; q is the number of database round trips. The EF Core column shows how many times longer EF took than redb on PostgreSQL. Hover FAIL or N/A for the reason.