Skip to content

Commit 8659603

Browse files
author
fabien.menager
committed
Add benchmarks
1 parent 1ae0e5f commit 8659603

5 files changed

Lines changed: 50 additions & 0 deletions

File tree

docs/images/bench-mysql.png

22.6 KB
Loading

docs/images/bench-oracle.png

24 KB
Loading

docs/images/bench-sqlite.png

26 KB
Loading

docs/images/bench-sqlserver.png

25.2 KB
Loading

docs/index.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ features:
2929

3030
## It's fast !
3131

32+
It's also memory efficient, with low allocations and garbage collection pressure, see benchmark results below.
33+
3234
The benchmark consists of inserting 500 000 records into a single table with various column types, using various methods to compare performance.
3335
The results are shown for PostgreSQL, SQL Server, SQLite, MySQL and Oracle databases.
3436

@@ -55,3 +57,51 @@ The benchmark code is available on [GitHub](https://github.com/PhenX/PhenX.Entit
5557
| Linq2Db | 1.427 s | 1.05 | 11000.0000 | 1000.0000 | - | 91.68 MB | 1.00 |
5658
| Z_EntityFramework_Extensions_EFCore | 3.750 s | 2.76 | 53000.0000 | 1000.0000 | - | 439.14 MB | 4.79 |
5759
| EFCore_BulkExtensions | 13.432 s | 9.88 | 29000.0000 | 2000.0000 | - | 232.77 MB | 2.54 |
60+
61+
### MySQL
62+
63+
![MySQL benchmark results](images/bench-mysql.png)
64+
65+
| Method | Mean | Ratio | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
66+
|--------------------------------------|---------:|------:|------------:|-----------:|----------:|-----------:|------------:|
67+
| PhenX_EntityFrameworkCore_BulkInsert | 4.369 s | 1.02 | 18000.0000 | 1000.0000 | - | 147.12 MB | 1.00 |
68+
| RawInsert | 17.146 s | 4.00 | 33000.0000 | 13000.0000 | 1000.0000 | 266.41 MB | 1.81 |
69+
| Linq2Db | 4.680 s | 1.09 | 18000.0000 | 1000.0000 | - | 145.13 MB | 0.99 |
70+
| Z_EntityFramework_Extensions_EFCore | 37.362 s | 8.72 | 192000.0000 | 6000.0000 | - | 1554.77 MB | 10.57 |
71+
| EFCore_BulkExtensions | NA | ? | NA | NA | NA | NA | ? |
72+
73+
### SQLite
74+
75+
![SQLite benchmark results](images/bench-sqlite.png)
76+
77+
| Method | Mean | Ratio | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
78+
|--------------------------------------|--------:|------:|------------:|----------:|----------:|-----------:|------------:|
79+
| PhenX_EntityFrameworkCore_BulkInsert | 2.259 s | 1.00 | 69000.0000 | 1000.0000 | - | 554.55 MB | 1.00 |
80+
| RawInsert | 2.141 s | 0.95 | 78000.0000 | 1000.0000 | - | 625.5 MB | 1.13 |
81+
| Linq2Db | 4.452 s | 1.98 | 65000.0000 | 5000.0000 | 2000.0000 | 646.42 MB | 1.17 |
82+
| Z_EntityFramework_Extensions_EFCore | 3.008 s | 1.34 | 200000.0000 | 1000.0000 | - | 1613.93 MB | 2.91 |
83+
| EFCore_BulkExtensions | 2.850 s | 1.27 | 102000.0000 | 1000.0000 | - | 820.09 MB | 1.48 |
84+
85+
### SQL Server
86+
87+
![SQL Server benchmark results](images/bench-sqlserver.png)
88+
89+
| Method | Mean | Ratio | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
90+
|--------------------------------------|--------:|------:|-----------:|-----------:|----------:|----------:|------------:|
91+
| PhenX_EntityFrameworkCore_BulkInsert | 3.072 s | 1.01 | 11000.0000 | 1000.0000 | - | 87.76 MB | 1.00 |
92+
| RawInsert | 3.926 s | 1.29 | 38000.0000 | 16000.0000 | 1000.0000 | 310.32 MB | 3.54 |
93+
| Linq2Db | 3.294 s | 1.08 | 56000.0000 | 1000.0000 | - | 450.2 MB | 5.13 |
94+
| Z_EntityFramework_Extensions_EFCore | 3.773 s | 1.24 | 35000.0000 | 1000.0000 | - | 297.98 MB | 3.40 |
95+
| EFCore_BulkExtensions | 7.375 s | 2.42 | 48000.0000 | 11000.0000 | 1000.0000 | 461.71 MB | 5.26 |
96+
97+
### Oracle
98+
99+
![Oracle benchmark results](images/bench-oracle.png)
100+
101+
| Method | Mean | Ratio | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
102+
|--------------------------------------|---------:|------:|------------:|------------:|----------:|----------:|------------:|
103+
| PhenX_EntityFrameworkCore_BulkInsert | 4.943 s | 1.01 | 99000.0000 | 43000.0000 | 2000.0000 | 781.07 MB | 1.00 |
104+
| RawInsert | 13.651 s | 2.78 | 115000.0000 | 48000.0000 | 3000.0000 | 907.65 MB | 1.16 |
105+
| Linq2Db | NA | ? | NA | NA | NA | NA | ? |
106+
| Z_EntityFramework_Extensions_EFCore | 5.251 s | 1.07 | 107000.0000 | 101000.0000 | - | 873.4 MB | 1.12 |
107+
| EFCore_BulkExtensions | NA | ? | NA | NA | NA | NA | ? |

0 commit comments

Comments
 (0)