Home

Awesome

EntityFrameworkCore.SqlServer.SimpleBulks

A very simple .net core library that can help to sync a large number of records in-memory into the database using the SqlBulkCopy class.  

Overview

This library provides extension methods so that you can use with your EntityFrameworkCore DbContext instance DbContextExtensions.cs or you can use SqlConnectionExtensions.cs to work directly with a SqlConnection instance without using EntityFrameworkCore.

Nuget

https://www.nuget.org/packages/EntityFrameworkCore.SqlServer.SimpleBulks

Features

Examples

EntityFrameworkCore.SqlServer.SimpleBulks.Demo

DbContextExtensions

Using Lambda Expression

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 Dynamic String

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" ]);

Using Builder Approach in case you need to mix both Dynamic & Lambda Expression

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);

SqlConnectionExtensions

Using Lambda Expression

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 Dynamic String

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" ]);

Using Builder Approach in case you need to mix both Dynamic & Lambda Expression

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);

Configuration

BulkInsert

_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;
    });

BulkUpdate

_context.BulkUpdate(rows,
    row => new { row.Column3, row.Column2 },
    options =>
    {
        options.BatchSize = 0;
        options.Timeout = 30;
        options.LogTo = Console.WriteLine;
    });

BulkDelete

_context.BulkDelete(rows,
    options =>
    {
        options.BatchSize = 0;
        options.Timeout = 30;
        options.LogTo = Console.WriteLine;
    });

BulkMerge

_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;
    });

BulkMatch

var contactsFromDb = _context.BulkMatch(matchedContacts,
    x => new { x.CustomerId, x.CountryIsoCode },
    options =>
    {
        options.BatchSize = 0;
        options.Timeout = 30;
        options.LogTo = Console.WriteLine;
    });

TempTable

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;
    });

DirectInsert

_context.DirectInsert(row,
    row => new { row.Column1, row.Column2, row.Column3 },
    options =>
    {
        options.Timeout = 30;
        options.LogTo = Console.WriteLine;
    });

DirectUpdate

_context.DirectUpdate(row,
    row => new { row.Column3, row.Column2 },
    options =>
    {
        options.Timeout = 30;
        options.LogTo = Console.WriteLine;
    });

DirectDelete

_context.DirectDelete(row,
    options =>
    {
        options.Timeout = 30;
        options.LogTo = Console.WriteLine;
    });

Returned Result

BulkUpdate

var updateResult = dbct.BulkUpdate(rows, row => new { row.Column3, row.Column2 });

Console.WriteLine($"Updated: {updateResult.AffectedRows} row(s)");

BulkDelete

var deleteResult = dbct.BulkDelete(rows);

Console.WriteLine($"Deleted: {deleteResult.AffectedRows} row(s)");

BulkMerge

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)");

Benchmarks

BulkInsert

Single Table /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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
EFCoreInsert10045.19 msNA---985.52 KB
BulkInsert10032.68 msNA---93.78 KB
EFCoreInsert1000145.41 msNA1000.0000--9702.7 KB
BulkInsert100044.94 msNA---573.84 KB
EFCoreInsert10000788.90 msNA14000.00005000.0000-95727.38 KB
BulkInsert10000126.36 msNA---5320.53 KB
EFCoreInsert1000007,107.29 msNA146000.000036000.0000-950162.56 KB
BulkInsert100000998.42 msNA7000.00003000.00001000.000051730.81 KB
EFCoreInsert25000018,542.56 msNA365000.000087000.0000-2352262.34 KB
BulkInsert2500002,576.88 msNA16000.00005000.00001000.0000125832.63 KB
EFCoreInsert50000034,957.34 msNA730000.0000170000.0000-4711772.88 KB
BulkInsert5000005,553.61 msNA30000.00009000.00001000.0000252707.77 KB

Multiple Tables (1x parent rows + 5x child rows) /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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
EFCoreInsert100226.22 msNA1000.0000--7438.51 KB
BulkInsert10048.38 msNA---444.18 KB
EFCoreInsert1000566.95 msNA11000.00004000.0000-73518.48 KB
BulkInsert1000125.77 msNA---3460.21 KB
EFCoreInsert100006,268.42 msNA114000.000030000.0000-731076.92 KB
BulkInsert100001,066.74 msNA5000.00002000.00001000.000033324.16 KB
EFCoreInsert10000059,389.89 msNA1138000.0000264000.0000-7282561.93 KB
BulkInsert1000009,504.12 msNA39000.000013000.00001000.0000327100.08 KB

BulkUpdate

/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  

MethodRowsCountMeanErrorGen0Gen1Allocated
EFCoreUpdate10061.65 msNA--853.66 KB
BulkUpdate10027.33 msNA--63.55 KB
EFCoreUpdate1000143.39 msNA1000.0000-8398.1 KB
BulkUpdate100043.95 msNA--379.25 KB
EFCoreUpdate10000685.97 msNA12000.00003000.000082396.19 KB
BulkUpdate10000182.54 msNA--3499.74 KB
EFCoreUpdate1000008,495.18 msNA120000.000028000.0000810248.07 KB
BulkUpdate1000002,091.42 msNA5000.00001000.000033819.46 KB
EFCoreUpdate25000017,859.49 msNA300000.000069000.00002005895.77 KB
BulkUpdate2500004,290.07 msNA13000.00007000.000084352 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  

MethodRowsCountMeanErrorGen0Gen1Allocated
BulkUpdate50000010.19 sNA27000.000016000.0000164.63 MB
BulkUpdate100000017.03 sNA54000.000037000.0000329.12 MB

BulkDelete

/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  

MethodRowsCountMeanErrorGen0Gen1Allocated
EFCoreDelete10073.25 msNA--681.09 KB
BulkDelete10029.42 msNA--43.45 KB
EFCoreDelete1000176.83 msNA1000.00001000.00006745 KB
BulkDelete100027.19 msNA--236.86 KB
EFCoreDelete100001,489.03 msNA10000.00002000.000066031.55 KB
BulkDelete10000431.74 msNA--2150.99 KB
EFCoreDelete200006,084.87 msNA20000.00007000.0000132403.3 KB
BulkDelete20000276.52 msNA--4276.01 KB
EFCoreDelete5000039,933.60 msNA49000.000014000.0000326164.25 KB
BulkDelete500001,477.09 msNA1000.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  

MethodRowsCountMeanErrorGen0Gen1Allocated
BulkDelete100000937.7 msNA3000.00001000.000020.67 MB
BulkDelete2500002,619.7 msNA7000.00003000.000051.7 MB
BulkDelete5000004,897.7 msNA13000.00006000.0000103.22 MB
BulkDelete10000009,466.0 msNA26000.000012000.0000206.28 MB

BulkMerge

/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMergeBenchmarks.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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
EFCoreUpsert10082.11 msNA---1840.23 KB
BulkMerge10034.27 msNA---162.96 KB
EFCoreUpsert1000266.86 msNA2000.00001000.0000-17984.91 KB
BulkMerge100079.45 msNA---1213.33 KB
EFCoreUpsert100001,451.20 msNA26000.00008000.0000-178385.15 KB
BulkMerge10000677.47 msNA1000.0000--11679.42 KB
EFCoreUpsert10000013,902.06 msNA266000.000063000.0000-1762696.52 KB
BulkMerge1000003,415.31 msNA16000.00006000.00001000.0000115233.2 KB
EFCoreUpsert25000036,167.51 msNA665000.0000152000.0000-4362872.57 KB
BulkMerge2500007,681.71 msNA37000.000011000.00001000.0000284187.09 KB

/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMergeReturnDbGeneratedIdBenchmarks.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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
ReturnDbGeneratedId10038.45 msNA---151.09 KB
NotReturnDbGeneratedId10037.75 msNA---116.8 KB
ReturnDbGeneratedId100067.42 msNA---1099.48 KB
NotReturnDbGeneratedId100060.02 msNA---769.23 KB
ReturnDbGeneratedId10000783.73 msNA1000.0000--10543.62 KB
NotReturnDbGeneratedId10000501.07 msNA1000.0000--7348.79 KB
ReturnDbGeneratedId1000003,187.89 msNA14000.00005000.00001000.0000103878.09 KB
NotReturnDbGeneratedId1000002,741.31 msNA11000.00005000.00001000.000072936.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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
ReturnDbGeneratedId2500007.799 sNA32000.00008000.0000-249.8 MB
NotReturnDbGeneratedId2500006.619 sNA24000.00007000.0000-177.7 MB
ReturnDbGeneratedId50000015.051 sNA66000.000019000.00001000.0000500.64 MB
NotReturnDbGeneratedId50000014.328 sNA47000.000014000.0000-355.19 MB
ReturnDbGeneratedId100000032.449 sNA129000.000034000.0000-1003.67 MB
NotReturnDbGeneratedId100000028.253 sNA95000.000028000.0000-710.22 MB

BulkMatch

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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
EFCoreSelect10097.373 msNA---1008.33 KB
EFCoreBatchSelect1007.166 msNA---94.77 KB
BulkMatch1008.570 msNA---106.63 KB
EFCoreSelect1000720.250 msNA1000.0000--9761.42 KB
EFCoreBatchSelect10006.375 msNA---908.18 KB
BulkMatch100015.445 msNA---820.36 KB
EFCoreSelect100008,075.686 msNA15000.00001000.0000-97115.62 KB
EFCoreBatchSelect1000066.438 msNA1000.0000--9092.91 KB
BulkMatch1000069.430 msNA1000.0000--8177.76 KB
EFCoreSelect10000081,088.718 msNA159000.000031000.00001000.0000972204.7 KB
EFCoreBatchSelect100000920.412 msNA11000.00004000.00001000.000091808.56 KB
BulkMatch100000742.030 msNA13000.00006000.00001000.000082419.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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
EFCoreBatchSelect2500002.101 sNA26000.000011000.00001000.0000224.05 MB
BulkMatch2500002.067 sNA32000.000012000.00001000.0000201.64 MB
EFCoreBatchSelect5000004.239 sNA53000.000020000.00002000.0000448.85 MB
BulkMatch5000004.507 sNA62000.000024000.00001000.0000404.03 MB
EFCoreBatchSelect10000008.523 sNA103000.000038000.00001000.0000898.44 MB
BulkMatch100000011.585 sNA123000.000046000.00001000.0000808.82 MB

Multiple Columns /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  

MethodRowsCountMeanErrorGen0Gen1Allocated
EFCoreSelect100130.11 msNA--1256.8 KB
BulkMatch10015.46 msNA--173.56 KB
EFCoreSelect1000997.87 msNA2000.0000-12373.85 KB
BulkMatch100043.35 msNA--1358.77 KB
EFCoreSelect100009,769.96 msNA20000.00004000.0000123595.97 KB
BulkMatch10000238.80 msNA2000.00001000.000013768.49 KB
EFCoreSelect10000089,204.16 msNA201000.000051000.00001237424.23 KB
BulkMatch1000002,612.00 msNA21000.00008000.0000138686.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  

MethodRowsCountMeanErrorGen0Gen1Allocated
BulkMatch2500006.709 sNA53000.000019000.0000340.68 MB
BulkMatch50000012.939 sNA107000.000036000.0000683.46 MB
BulkMatch100000025.418 sNA214000.000074000.00001369.34 MB

TempTable

/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  

MethodRowsCountMeanErrorGen0Gen1Gen2Allocated
CreateTempTable1007.639 msNA---68.03 KB
CreateTempTable100014.077 msNA---373.76 KB
CreateTempTable1000089.789 msNA---3455.46 KB
CreateTempTable100000574.937 msNA4000.00001000.0000-34081.95 KB
CreateTempTable2500001,403.071 msNA12000.00005000.00001000.000085229.91 KB
CreateTempTable5000002,838.562 msNA22000.00008000.00001000.0000170241.85 KB
CreateTempTable10000006,198.206 msNA43000.000014000.00001000.0000340282.7 KB

License

EntityFrameworkCore.SqlServer.SimpleBulks is licensed under the MIT license.