Eine sehr einfache .NET-Kernbibliothek, die dazu beitragen kann, eine große Anzahl von Datensätzen mithilfe der SQLBulkCopy -Klasse in die Datenbank zu synchronisieren.
Diese Bibliothek bietet Erweiterungsmethoden, damit Sie mit Ihren EntityFrameworkCore dbContext -Instanz dbContextextENs.cs verwenden können, oder Sie können sqlConnectionExponsions.cs verwenden, um direkt mit einer SQLConnection -Instanz zu arbeiten, ohne EntityFrameworkCore zu verwenden.
https://www.nuget.org/packages/entityframeworkcore.sqlserver.simlebulks
EntityFrameworkCore.SQLSERVER.SIMPLEBULKS.DEMO
private const string _connectionString = "Server=.;Database=SimpleBulks;User Id=xxx;Password=xxx" ; using EntityFrameworkCore . SqlServer . SimpleBulks . BulkDelete ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkInsert ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkMerge ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkUpdate ;
// Insert all columns
dbct . BulkInsert ( rows ) ;
dbct . BulkInsert ( compositeKeyRows ) ;
// Insert selected columns only
dbct . BulkInsert ( rows ,
row => new { row . Column1 , row . Column2 , row . Column3 } ) ;
dbct . BulkInsert ( compositeKeyRows ,
row => new { row . Id1 , row . Id2 , row . Column1 , row . Column2 , row . Column3 } ) ;
dbct . BulkUpdate ( rows ,
row => new { row . Column3 , row . Column2 } ) ;
dbct . BulkUpdate ( compositeKeyRows ,
row => new { row . Column3 , row . Column2 } ) ;
dbct . BulkMerge ( rows ,
row => row . Id ,
row => new { row . Column1 , row . Column2 } ,
row => new { row . Column1 , row . Column2 , row . Column3 } ) ;
dbct . BulkMerge ( compositeKeyRows ,
row => new { row . Id1 , row . Id2 } ,
row => new { row . Column1 , row . Column2 , row . Column3 } ,
row => new { row . Id1 , row . Id2 , row . Column1 , row . Column2 , row . Column3 } ) ;
dbct . BulkDelete ( rows ) ;
dbct . BulkDelete ( compositeKeyRows ) ; using EntityFrameworkCore . SqlServer . SimpleBulks . BulkDelete ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkInsert ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkMerge ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkUpdate ;
dbct . BulkUpdate ( rows ,
[ "Column3" , "Column2" ] ) ;
dbct . BulkUpdate ( compositeKeyRows ,
[ "Column3" , "Column2" ] ) ;
dbct . BulkMerge ( rows ,
"Id" ,
[ "Column1" , "Column2" ] ,
[ "Column1" , "Column2" , "Column3" ] ) ;
dbct . BulkMerge ( compositeKeyRows ,
[ "Id1" , "Id2" ] ,
[ "Column1" , "Column2" , "Column3" ] ,
[ "Id1" , "Id2" , "Column1" , "Column2" , "Column3" ] ) ; new BulkInsertBuilder < Row > ( dbct . GetSqlConnection ( ) )
. WithColumns ( row => new { row . Column1 , row . Column2 , row . Column3 } )
// or .WithColumns([ "Column1", "Column2", "Column3" ])
. WithOutputId ( row => row . Id )
// or .WithOutputId("Id")
. ToTable ( dbct . GetTableName ( typeof ( Row ) ) )
// or .ToTable("Rows")
. Execute ( rows ) ; using EntityFrameworkCore . SqlServer . SimpleBulks . BulkDelete ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkInsert ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkMerge ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkUpdate ;
// Register Type - Table Name globaly
TableMapper . Register ( typeof ( Row ) , "Rows" ) ;
TableMapper . Register ( typeof ( CompositeKeyRow ) , "CompositeKeyRows" ) ;
connection . BulkInsert ( rows ,
row => new { row . Column1 , row . Column2 , row . Column3 } ) ;
connection . BulkInsert ( compositeKeyRows ,
row => new { row . Id1 , row . Id2 , row . Column1 , row . Column2 , row . Column3 } ) ;
connection . BulkUpdate ( rows ,
row => row . Id ,
row => new { row . Column3 , row . Column2 } ) ;
connection . BulkUpdate ( compositeKeyRows ,
row => new { row . Id1 , row . Id2 } ,
row => new { row . Column3 , row . Column2 } ) ;
connection . BulkMerge ( rows ,
row => row . Id ,
row => new { row . Column1 , row . Column2 } ,
row => new { row . Column1 , row . Column2 , row . Column3 } ) ;
connection . BulkMerge ( compositeKeyRows ,
row => new { row . Id1 , row . Id2 } ,
row => new { row . Column1 , row . Column2 , row . Column3 } ,
row => new { row . Id1 , row . Id2 , row . Column1 , row . Column2 , row . Column3 } ) ;
connection . BulkDelete ( rows , row => row . Id ) ;
connection . BulkDelete ( compositeKeyRows , row => new { row . Id1 , row . Id2 } ) ; using EntityFrameworkCore . SqlServer . SimpleBulks . BulkDelete ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkInsert ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkMerge ;
using EntityFrameworkCore . SqlServer . SimpleBulks . BulkUpdate ;
connection . BulkInsert ( rows , "Rows" ,
[ "Column1" , "Column2" , "Column3" ] ) ;
connection . BulkInsert ( rows . Take ( 1000 ) , "Rows" ,
typeof ( Row ) . GetDbColumnNames ( "Id" ) ) ;
connection . BulkInsert ( compositeKeyRows , "CompositeKeyRows" ,
[ "Id1" , "Id2" , "Column1" , "Column2" , "Column3" ] ) ;
connection . BulkUpdate ( rows , "Rows" ,
"Id" ,
[ "Column3" , "Column2" ] ) ;
connection . BulkUpdate ( compositeKeyRows , "CompositeKeyRows" ,
[ "Id1" , "Id2" ] ,
[ "Column3" , "Column2" ] ) ;
connection . BulkMerge ( rows , "Rows" ,
"Id" ,
[ "Column1" , "Column2" ] ,
[ "Column1" , "Column2" , "Column3" ] ) ;
connection . BulkMerge ( compositeKeyRows , "CompositeKeyRows" ,
[ "Id1" , "Id2" ] ,
[ "Column1" , "Column2" , "Column3" ] ,
[ "Id1" , "Id2" , "Column1" , "Column2" , "Column3" ] ) ;
connection . BulkDelete ( rows , "Rows" , "Id" ) ;
connection . BulkDelete ( compositeKeyRows , "CompositeKeyRows" , [ "Id1" , "Id2" ] ) ; new BulkInsertBuilder < Row > ( connection )
. WithColumns ( row => new { row . Column1 , row . Column2 , row . Column3 } )
// or .WithColumns([ "Column1", "Column2", "Column3" ])
. WithOutputId ( row => row . Id )
// or .WithOutputId("Id")
. ToTable ( "Rows" )
. Execute ( rows ) ; _context . BulkInsert ( rows ,
row => new { row . Column1 , row . Column2 , row . Column3 } ,
options =>
{
options . KeepIdentity = false ;
options . BatchSize = 0 ;
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; _context . BulkUpdate ( rows ,
row => new { row . Column3 , row . Column2 } ,
options =>
{
options . BatchSize = 0 ;
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; _context . BulkDelete ( rows ,
options =>
{
options . BatchSize = 0 ;
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; _context . BulkMerge ( rows ,
row => row . Id ,
row => new { row . Column1 , row . Column2 } ,
row => new { row . Column1 , row . Column2 , row . Column3 } ,
options =>
{
options . BatchSize = 0 ;
options . Timeout = 30 ;
options . WithHoldLock = false ;
options . ReturnDbGeneratedId = true ;
options . LogTo = Console . WriteLine ;
} ) ; var contactsFromDb = _context . BulkMatch ( matchedContacts ,
x => new { x . CustomerId , x . CountryIsoCode } ,
options =>
{
options . BatchSize = 0 ;
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; var customerTableName = _context . CreateTempTable ( customers ,
x => new
{
x . IdNumber ,
x . FirstName ,
x . LastName ,
x . CurrentCountryIsoCode
} ,
options =>
{
options . BatchSize = 0 ;
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; _context . DirectInsert ( row ,
row => new { row . Column1 , row . Column2 , row . Column3 } ,
options =>
{
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; _context . DirectUpdate ( row ,
row => new { row . Column3 , row . Column2 } ,
options =>
{
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; _context . DirectDelete ( row ,
options =>
{
options . Timeout = 30 ;
options . LogTo = Console . WriteLine ;
} ) ; var updateResult = dbct . BulkUpdate ( rows , row => new { row . Column3 , row . Column2 } ) ;
Console . WriteLine ( $ "Updated: { updateResult . AffectedRows } row(s)" ) ; var deleteResult = dbct . BulkDelete ( rows ) ;
Console . WriteLine ( $ "Deleted: { deleteResult . AffectedRows } row(s)" ) ; var mergeResult = dbct . BulkMerge ( rows ,
row => row . Id ,
row => new { row . Column1 , row . Column2 } ,
row => new { row . Column1 , row . Column2 , row . Column3 } ) ;
Console . WriteLine ( $ "Updated: { mergeResult . UpdatedRows } row(s)" ) ;
Console . WriteLine ( $ "Inserted: { mergeResult . InsertedRows } row(s)" ) ;
Console . WriteLine ( $ "Affected: { mergeResult . AffectedRows } row(s)" ) ; Single Tabelle /src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/BulkinsertsingLetableBenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| Efcoreinsert | 100 | 45,19 ms | N / A | - - | - - | - - | 985,52 kb |
| Bulkinsert | 100 | 32,68 ms | N / A | - - | - - | - - | 93.78 kb |
| Efcoreinsert | 1000 | 145.41 ms | N / A | 1000.0000 | - - | - - | 9702.7 KB |
| Bulkinsert | 1000 | 44,94 ms | N / A | - - | - - | - - | 573.84 kb |
| Efcoreinsert | 10000 | 788,90 ms | N / A | 14000.0000 | 5000.0000 | - - | 95727.38 KB |
| Bulkinsert | 10000 | 126,36 ms | N / A | - - | - - | - - | 5320.53 KB |
| Efcoreinsert | 100000 | 7,107,29 ms | N / A | 146000.0000 | 36000.0000 | - - | 950162.56 KB |
| Bulkinsert | 100000 | 998,42 ms | N / A | 7000.0000 | 3000.0000 | 1000.0000 | 51730.81 KB |
| Efcoreinsert | 250000 | 18.542,56 ms | N / A | 365000.0000 | 87000.0000 | - - | 2352262.34 KB |
| Bulkinsert | 250000 | 2.576,88 ms | N / A | 16000.0000 | 5000.0000 | 1000.0000 | 125832.63 KB |
| Efcoreinsert | 500000 | 34.957,34 ms | N / A | 730000.0000 | 170000.0000 | - - | 4711772.88 KB |
| Bulkinsert | 500000 | 5,553,61 ms | N / A | 30000.0000 | 9000.0000 | 1000.0000 | 252707.77 KB |
Mehrere Tabellen (1x übergeordnete Zeilen + 5x untergeordnete Zeilen) /src/entityframeworkcore.sqlserver.simplebulks.Benchmarks/BulkinsertMultipletablesBenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| Efcoreinsert | 100 | 226,22 ms | N / A | 1000.0000 | - - | - - | 7438.51 KB |
| Bulkinsert | 100 | 48,38 ms | N / A | - - | - - | - - | 444.18 kb |
| Efcoreinsert | 1000 | 566,95 ms | N / A | 11000.0000 | 4000.0000 | - - | 73518.48 KB |
| Bulkinsert | 1000 | 125,77 ms | N / A | - - | - - | - - | 3460.21 KB |
| Efcoreinsert | 10000 | 6,268,42 ms | N / A | 114000.0000 | 30000.0000 | - - | 731076.92 KB |
| Bulkinsert | 10000 | 1.066,74 ms | N / A | 5000.0000 | 2000.0000 | 1000.0000 | 33324.16 KB |
| Efcoreinsert | 100000 | 59.389,89 ms | N / A | 1138000.0000 | 264000.0000 | - - | 7282561.93 KB |
| Bulkinsert | 100000 | 9.504,12 ms | N / A | 39000.0000 | 13000.0000 | 1000.0000 | 327100.08 KB |
/src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/Bulkupdatebenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Zugewiesen |
|---|---|---|---|---|---|---|
| Efcoreupdate | 100 | 61,65 ms | N / A | - - | - - | 853.66 KB |
| Bulkupdate | 100 | 27,33 ms | N / A | - - | - - | 63,55 kb |
| Efcoreupdate | 1000 | 143.39 ms | N / A | 1000.0000 | - - | 8398.1 KB |
| Bulkupdate | 1000 | 43,95 ms | N / A | - - | - - | 379,25 kb |
| Efcoreupdate | 10000 | 685,97 ms | N / A | 12000.0000 | 3000.0000 | 82396.19 KB |
| Bulkupdate | 10000 | 182,54 ms | N / A | - - | - - | 3499.74 KB |
| Efcoreupdate | 100000 | 8.495,18 ms | N / A | 120000.0000 | 28000.0000 | 810248.07 KB |
| Bulkupdate | 100000 | 2.091,42 ms | N / A | 5000.0000 | 1000.0000 | 33819.46 KB |
| Efcoreupdate | 250000 | 17.859,49 ms | N / A | 300000.0000 | 69000.0000 | 2005895.77 KB |
| Bulkupdate | 250000 | 4,290,07 ms | N / A | 13000.0000 | 7000.0000 | 84352 kb |
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Zugewiesen |
|---|---|---|---|---|---|---|
| Bulkupdate | 500000 | 10.19 s | N / A | 27000.0000 | 16000.0000 | 164,63 MB |
| Bulkupdate | 1000000 | 17.03 s | N / A | 54000.0000 | 37000.0000 | 329.12 MB |
/src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/Bulkdeletebenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Zugewiesen |
|---|---|---|---|---|---|---|
| Efcoredelete | 100 | 73,25 ms | N / A | - - | - - | 681.09 KB |
| Bulkdelete | 100 | 29,42 ms | N / A | - - | - - | 43,45 kb |
| Efcoredelete | 1000 | 176,83 ms | N / A | 1000.0000 | 1000.0000 | 6745 kb |
| Bulkdelete | 1000 | 27.19 ms | N / A | - - | - - | 236,86 kb |
| Efcoredelete | 10000 | 1.489,03 ms | N / A | 10000.0000 | 2000.0000 | 66031.55 kb |
| Bulkdelete | 10000 | 431,74 ms | N / A | - - | - - | 2150.99 KB |
| Efcoredelete | 20000 | 6,084,87 ms | N / A | 20000.0000 | 7000.0000 | 132403.3 kb |
| Bulkdelete | 20000 | 276,52 ms | N / A | - - | - - | 4276.01 kb |
| Efcoredelete | 50000 | 39.933,60 ms | N / A | 49000.0000 | 14000.0000 | 326164.25 kb |
| Bulkdelete | 50000 | 1.477,09 ms | N / A | 1000.0000 | - - | 10594.63 KB |
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Zugewiesen |
|---|---|---|---|---|---|---|
| Bulkdelete | 100000 | 937,7 ms | N / A | 3000.0000 | 1000.0000 | 20,67 MB |
| Bulkdelete | 250000 | 2.619,7 ms | N / A | 7000.0000 | 3000.0000 | 51,7 MB |
| Bulkdelete | 500000 | 4,897,7 ms | N / A | 13000.0000 | 6000.0000 | 103,22 MB |
| Bulkdelete | 1000000 | 9.466,0 ms | N / A | 26000.0000 | 12000.0000 | 206,28 MB |
/src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/Bulkmergebechmmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| Efcoreupsert | 100 | 82.11 ms | N / A | - - | - - | - - | 1840.23 KB |
| Bulkmerge | 100 | 34,27 ms | N / A | - - | - - | - - | 162,96 KB |
| Efcoreupsert | 1000 | 266,86 ms | N / A | 2000.0000 | 1000.0000 | - - | 17984.91 KB |
| Bulkmerge | 1000 | 79,45 ms | N / A | - - | - - | - - | 1213.33 kb |
| Efcoreupsert | 10000 | 1.451,20 ms | N / A | 26000.0000 | 8000.0000 | - - | 178385.15 kb |
| Bulkmerge | 10000 | 677,47 ms | N / A | 1000.0000 | - - | - - | 11679.42 KB |
| Efcoreupsert | 100000 | 13.902,06 ms | N / A | 266000.0000 | 63000.0000 | - - | 1762696.52 KB |
| Bulkmerge | 100000 | 3.415,31 ms | N / A | 16000.0000 | 6000.0000 | 1000.0000 | 115233.2 KB |
| Efcoreupsert | 250000 | 36,167,51 ms | N / A | 665000.0000 | 152000.0000 | - - | 4362872.57 KB |
| Bulkmerge | 250000 | 7.681,71 ms | N / A | 37000.0000 | 11000.0000 | 1000.0000 | 284187.09 KB |
/src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/BulkmerGerTurnDbGeneratedIdBenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| ReturnDbGeneratedID | 100 | 38,45 ms | N / A | - - | - - | - - | 151.09 kb |
| NotReturnDbGeneratedID | 100 | 37,75 ms | N / A | - - | - - | - - | 116,8 kb |
| ReturnDbGeneratedID | 1000 | 67,42 ms | N / A | - - | - - | - - | 1099.48 KB |
| NotReturnDbGeneratedID | 1000 | 60.02 ms | N / A | - - | - - | - - | 769,23 kb |
| ReturnDbGeneratedID | 10000 | 783,73 ms | N / A | 1000.0000 | - - | - - | 10543.62 kb |
| NotReturnDbGeneratedID | 10000 | 501.07 ms | N / A | 1000.0000 | - - | - - | 7348.79 KB |
| ReturnDbGeneratedID | 100000 | 3,187,89 ms | N / A | 14000.0000 | 5000.0000 | 1000.0000 | 103878.09 KB |
| NotReturnDbGeneratedID | 100000 | 2.741,31 ms | N / A | 11000.0000 | 5000.0000 | 1000.0000 | 72936.01 kb |
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| ReturnDbGeneratedID | 250000 | 7.799 s | N / A | 32000.0000 | 8000.0000 | - - | 249,8 MB |
| NotReturnDbGeneratedID | 250000 | 6.619 s | N / A | 24000.0000 | 7000.0000 | - - | 177,7 MB |
| ReturnDbGeneratedID | 500000 | 15.051 s | N / A | 66000.0000 | 19000.0000 | 1000.0000 | 500,64 MB |
| NotReturnDbGeneratedID | 500000 | 14.328 s | N / A | 47000.0000 | 14000.0000 | - - | 355.19 MB |
| ReturnDbGeneratedID | 1000000 | 32.449 s | N / A | 129000.0000 | 34000.0000 | - - | 1003,67 MB |
| NotReturnDbGeneratedID | 1000000 | 28.253 s | N / A | 95000.0000 | 28000.0000 | - - | 710,22 MB |
Single Column /src/entityFrameworkCore.SQLSERVER.Simplebulks.Benchmarks/BulkMatchsingleColumnBenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| EfcoresSelect | 100 | 97,373 ms | N / A | - - | - - | - - | 1008,33 kb |
| EfcorebatchSelect | 100 | 7.166 ms | N / A | - - | - - | - - | 94.77 kb |
| Bulkmatch | 100 | 8,570 ms | N / A | - - | - - | - - | 106,63 kb |
| EfcoresSelect | 1000 | 720,250 ms | N / A | 1000.0000 | - - | - - | 9761.42 KB |
| EfcorebatchSelect | 1000 | 6,375 ms | N / A | - - | - - | - - | 908.18 kb |
| Bulkmatch | 1000 | 15.445 ms | N / A | - - | - - | - - | 820.36 kb |
| EfcoresSelect | 10000 | 8.075,686 ms | N / A | 15000.0000 | 1000.0000 | - - | 97115.62 KB |
| EfcorebatchSelect | 10000 | 66.438 ms | N / A | 1000.0000 | - - | - - | 9092.91 KB |
| Bulkmatch | 10000 | 69,430 ms | N / A | 1000.0000 | - - | - - | 8177.76 KB |
| EfcoresSelect | 100000 | 81.088,718 ms | N / A | 159000.0000 | 31000.0000 | 1000.0000 | 972204.7 KB |
| EfcorebatchSelect | 100000 | 920.412 ms | N / A | 11000.0000 | 4000.0000 | 1000.0000 | 91808.56 KB |
| Bulkmatch | 100000 | 742.030 ms | N / A | 13000.0000 | 6000.0000 | 1000.0000 | 82419.43 KB |
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| EfcorebatchSelect | 250000 | 2.101 s | N / A | 26000.0000 | 11000.0000 | 1000.0000 | 224,05 MB |
| Bulkmatch | 250000 | 2.067 s | N / A | 32000.0000 | 12000.0000 | 1000.0000 | 201.64 MB |
| EfcorebatchSelect | 500000 | 4.239 s | N / A | 53000.0000 | 20000.0000 | 2000.0000 | 448,85 MB |
| Bulkmatch | 500000 | 4,507 s | N / A | 62000.0000 | 24000.0000 | 1000.0000 | 404.03 MB |
| EfcorebatchSelect | 1000000 | 8.523 s | N / A | 103000.0000 | 38000.0000 | 1000.0000 | 898,44 MB |
| Bulkmatch | 1000000 | 11.585 s | N / A | 123000.0000 | 46000.0000 | 1000.0000 | 808,82 MB |
Mehrere Spalten /src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/BulkMatchMultipleColumnsbenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Zugewiesen |
|---|---|---|---|---|---|---|
| EfcoresSelect | 100 | 130,11 ms | N / A | - - | - - | 1256,8 kb |
| Bulkmatch | 100 | 15,46 ms | N / A | - - | - - | 173.56 KB |
| EfcoresSelect | 1000 | 997,87 ms | N / A | 2000.0000 | - - | 12373.85 kb |
| Bulkmatch | 1000 | 43,35 ms | N / A | - - | - - | 1358.77 KB |
| EfcoresSelect | 10000 | 9.769,96 ms | N / A | 20000.0000 | 4000.0000 | 123595.97 KB |
| Bulkmatch | 10000 | 238,80 ms | N / A | 2000.0000 | 1000.0000 | 13768.49 KB |
| EfcoresSelect | 100000 | 89.204,16 ms | N / A | 201000.0000 | 51000.0000 | 1237424.23 KB |
| Bulkmatch | 100000 | 2.612,00 ms | N / A | 21000.0000 | 8000.0000 | 138686.52 KB |
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Zugewiesen |
|---|---|---|---|---|---|---|
| Bulkmatch | 250000 | 6.709 s | N / A | 53000.0000 | 19000.0000 | 340,68 MB |
| Bulkmatch | 500000 | 12.939 s | N / A | 107000.0000 | 36000.0000 | 683,46 MB |
| Bulkmatch | 1000000 | 25.418 s | N / A | 214000.0000 | 74000.0000 | 1369,34 MB |
/src/entityframeworkcore.sqlServer.Simplebulks.Benchmarks/TemptableBenchmarks.cs
BenchmarkDotNet =v0.13.2, OS =Windows 10 (10.0.19045.5011)
11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK =8.0.400
[Host] : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
InvocationCount =1 IterationCount =1 UnrollFactor =1
WarmupCount =0
| Verfahren | Rowscount | Bedeuten | Fehler | Gen0 | Gen1 | Gen2 | Zugewiesen |
|---|---|---|---|---|---|---|---|
| Schöpferbar | 100 | 7,639 ms | N / A | - - | - - | - - | 68.03 kb |
| Schöpferbar | 1000 | 14.077 ms | N / A | - - | - - | - - | 373.76 KB |
| Schöpferbar | 10000 | 89.789 ms | N / A | - - | - - | - - | 3455.46 KB |
| Schöpferbar | 100000 | 574.937 ms | N / A | 4000.0000 | 1000.0000 | - - | 34081.95 KB |
| Schöpferbar | 250000 | 1.403,071 ms | N / A | 12000.0000 | 5000.0000 | 1000.0000 | 85229.91 KB |
| Schöpferbar | 500000 | 2,838,562 ms | N / A | 22000.0000 | 8000.0000 | 1000.0000 | 170241.85 KB |
| Schöpferbar | 1000000 | 6,198,206 ms | N / A | 43000.0000 | 14000.0000 | 1000.0000 | 340282.7 KB |
EntityFrameworkCore.sqlServer.SimpleBulks ist unter der MIT -Lizenz lizenziert.