{"id":13753185,"url":"https://github.com/phongnguyend/EntityFrameworkCore.SqlServer.SimpleBulks","last_synced_at":"2025-05-09T20:35:00.080Z","repository":{"id":139479619,"uuid":"105147991","full_name":"phongnguyend/EntityFrameworkCore.SqlServer.SimpleBulks","owner":"phongnguyend","description":"Fast and simple bulk insert (retain client populated Ids or return db generated Ids), bulk update, bulk delete, bulk merge and bulk match for SQL Server.","archived":false,"fork":false,"pushed_at":"2025-03-13T03:58:45.000Z","size":1004,"stargazers_count":170,"open_issues_count":0,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T04:05:03.406Z","etag":null,"topics":["bulkdelete","bulkinsert","bulkmerge","bulkupdate","efcore","entityframeworkcore","net","netcore"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/EntityFrameworkCore.SqlServer.SimpleBulks","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phongnguyend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-28T12:54:28.000Z","updated_at":"2025-04-11T01:51:36.000Z","dependencies_parsed_at":"2023-03-20T22:06:32.108Z","dependency_job_id":"71d65286-1e5f-4ebd-a27e-cf088badb830","html_url":"https://github.com/phongnguyend/EntityFrameworkCore.SqlServer.SimpleBulks","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phongnguyend","download_url":"https://codeload.github.com/phongnguyend/EntityFrameworkCore.SqlServer.SimpleBulks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253321837,"owners_count":21890476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulkdelete","bulkinsert","bulkmerge","bulkupdate","efcore","entityframeworkcore","net","netcore"],"created_at":"2024-08-03T09:01:17.997Z","updated_at":"2025-05-09T20:34:55.800Z","avatar_url":"https://github.com/phongnguyend.png","language":"C#","readme":"# EntityFrameworkCore.SqlServer.SimpleBulks\nA very simple .net core library that can help to sync a large number of records in-memory into the database using the **SqlBulkCopy** class.\n \n## Overview\nThis library provides extension methods so that you can use with your EntityFrameworkCore **DbContext** instance **DbContextExtensions.cs**\nor you can use **SqlConnectionExtensions.cs** to work directly with a **SqlConnection** instance without using EntityFrameworkCore.\n\n## Nuget\nhttps://www.nuget.org/packages/EntityFrameworkCore.SqlServer.SimpleBulks\n\n## Features\n- Bulk Insert\n- Bulk Update\n- Bulk Delete\n- Bulk Merge\n- Bulk Match\n- Temp Table\n- Direct Insert\n- Direct Update\n- Direct Delete\n\n## Examples\n[EntityFrameworkCore.SqlServer.SimpleBulks.Demo](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Demo/Program.cs)\n- Update the connection string:\n  ```c#\n  private const string _connectionString = \"Server=.;Database=SimpleBulks;User Id=xxx;Password=xxx\";\n  ```\n- Build and run.\n\n## DbContextExtensions\n### Using Lambda Expression\n```c#\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkDelete;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkInsert;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkMerge;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkUpdate;\n\n// Insert all columns\ndbct.BulkInsert(rows);\ndbct.BulkInsert(compositeKeyRows);\n\n// Insert selected columns only\ndbct.BulkInsert(rows,\n    row =\u003e new { row.Column1, row.Column2, row.Column3 });\ndbct.BulkInsert(compositeKeyRows,\n    row =\u003e new { row.Id1, row.Id2, row.Column1, row.Column2, row.Column3 });\n\ndbct.BulkUpdate(rows,\n    row =\u003e new { row.Column3, row.Column2 });\ndbct.BulkUpdate(compositeKeyRows,\n    row =\u003e new { row.Column3, row.Column2 });\n\ndbct.BulkMerge(rows,\n    row =\u003e row.Id,\n    row =\u003e new { row.Column1, row.Column2 },\n    row =\u003e new { row.Column1, row.Column2, row.Column3 });\ndbct.BulkMerge(compositeKeyRows,\n    row =\u003e new { row.Id1, row.Id2 },\n    row =\u003e new { row.Column1, row.Column2, row.Column3 },\n    row =\u003e new { row.Id1, row.Id2, row.Column1, row.Column2, row.Column3 });\n                        \ndbct.BulkDelete(rows);\ndbct.BulkDelete(compositeKeyRows);\n```\n### Using Dynamic String\n```c#\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkDelete;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkInsert;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkMerge;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkUpdate;\n\ndbct.BulkUpdate(rows,\n    [ \"Column3\", \"Column2\" ]);\ndbct.BulkUpdate(compositeKeyRows,\n    [ \"Column3\", \"Column2\" ]);\n\ndbct.BulkMerge(rows,\n    \"Id\",\n    [ \"Column1\", \"Column2\" ],\n    [ \"Column1\", \"Column2\", \"Column3\" ]);\ndbct.BulkMerge(compositeKeyRows,\n    [ \"Id1\", \"Id2\" ],\n    [ \"Column1\", \"Column2\", \"Column3\" ],\n    [ \"Id1\", \"Id2\", \"Column1\", \"Column2\", \"Column3\" ]);\n```\n### Using Builder Approach in case you need to mix both Dynamic \u0026 Lambda Expression\n```c#\nnew BulkInsertBuilder\u003cRow\u003e(dbct.GetSqlConnection())\n\t.WithColumns(row =\u003e new { row.Column1, row.Column2, row.Column3 })\n\t// or .WithColumns([ \"Column1\", \"Column2\", \"Column3\" ])\n\t.WithOutputId(row =\u003e row.Id)\n\t// or .WithOutputId(\"Id\")\n\t.ToTable(dbct.GetTableName(typeof(Row)))\n\t// or .ToTable(\"Rows\")\n\t.Execute(rows);\n```\n\n## SqlConnectionExtensions\n### Using Lambda Expression\n```c#\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkDelete;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkInsert;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkMerge;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkUpdate;\n\n// Register Type - Table Name globaly\nTableMapper.Register(typeof(Row), \"Rows\");\nTableMapper.Register(typeof(CompositeKeyRow), \"CompositeKeyRows\");\n\nconnection.BulkInsert(rows,\n           row =\u003e new { row.Column1, row.Column2, row.Column3 });\nconnection.BulkInsert(compositeKeyRows,\n           row =\u003e new { row.Id1, row.Id2, row.Column1, row.Column2, row.Column3 });\n\nconnection.BulkUpdate(rows,\n           row =\u003e row.Id,\n           row =\u003e new { row.Column3, row.Column2 });\nconnection.BulkUpdate(compositeKeyRows,\n           row =\u003e new { row.Id1, row.Id2 },\n           row =\u003e new { row.Column3, row.Column2 });\n\nconnection.BulkMerge(rows,\n           row =\u003e row.Id,\n           row =\u003e new { row.Column1, row.Column2 },\n           row =\u003e new { row.Column1, row.Column2, row.Column3 });\nconnection.BulkMerge(compositeKeyRows,\n           row =\u003e new { row.Id1, row.Id2 },\n           row =\u003e new { row.Column1, row.Column2, row.Column3 },\n           row =\u003e new { row.Id1, row.Id2, row.Column1, row.Column2, row.Column3 });\n                        \nconnection.BulkDelete(rows, row =\u003e row.Id);\nconnection.BulkDelete(compositeKeyRows, row =\u003e new { row.Id1, row.Id2 });\n```\n### Using Dynamic String\n```c#\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkDelete;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkInsert;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkMerge;\nusing EntityFrameworkCore.SqlServer.SimpleBulks.BulkUpdate;\n\nconnection.BulkInsert(rows, \"Rows\",\n           [ \"Column1\", \"Column2\", \"Column3\" ]);\nconnection.BulkInsert(rows.Take(1000), \"Rows\",\n           typeof(Row).GetDbColumnNames(\"Id\"));\nconnection.BulkInsert(compositeKeyRows, \"CompositeKeyRows\",\n           [ \"Id1\", \"Id2\", \"Column1\", \"Column2\", \"Column3\" ]);\n\nconnection.BulkUpdate(rows, \"Rows\",\n           \"Id\",\n           [ \"Column3\", \"Column2\" ]);\nconnection.BulkUpdate(compositeKeyRows, \"CompositeKeyRows\",\n           [ \"Id1\", \"Id2\" ],\n           [ \"Column3\", \"Column2\" ]);\n\nconnection.BulkMerge(rows, \"Rows\",\n           \"Id\",\n           [ \"Column1\", \"Column2\" ],\n           [ \"Column1\", \"Column2\", \"Column3\" ]);\nconnection.BulkMerge(compositeKeyRows, \"CompositeKeyRows\",\n           [ \"Id1\", \"Id2\" ],\n           [ \"Column1\", \"Column2\", \"Column3\" ],\n           [ \"Id1\", \"Id2\", \"Column1\", \"Column2\", \"Column3\" ]);\n\nconnection.BulkDelete(rows, \"Rows\", \"Id\");\nconnection.BulkDelete(compositeKeyRows, \"CompositeKeyRows\", [ \"Id1\", \"Id2\" ]);\n```\n### Using Builder Approach in case you need to mix both Dynamic \u0026 Lambda Expression\n```c#\nnew BulkInsertBuilder\u003cRow\u003e(connection)\n\t.WithColumns(row =\u003e new { row.Column1, row.Column2, row.Column3 })\n\t// or .WithColumns([ \"Column1\", \"Column2\", \"Column3\" ])\n\t.WithOutputId(row =\u003e row.Id)\n\t// or .WithOutputId(\"Id\")\n\t.ToTable(\"Rows\")\n\t.Execute(rows);\n```\n\n## Configuration\n### BulkInsert\n```c#\n_context.BulkInsert(rows,\n    row =\u003e new { row.Column1, row.Column2, row.Column3 },\n    options =\u003e\n    {\n        options.KeepIdentity = false;\n        options.BatchSize = 0;\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### BulkUpdate\n```c#\n_context.BulkUpdate(rows,\n    row =\u003e new { row.Column3, row.Column2 },\n    options =\u003e\n    {\n        options.BatchSize = 0;\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### BulkDelete\n```c#\n_context.BulkDelete(rows,\n    options =\u003e\n    {\n        options.BatchSize = 0;\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### BulkMerge\n```c#\n_context.BulkMerge(rows,\n    row =\u003e row.Id,\n    row =\u003e new { row.Column1, row.Column2 },\n    row =\u003e new { row.Column1, row.Column2, row.Column3 },\n    options =\u003e\n    {\n        options.BatchSize = 0;\n        options.Timeout = 30;\n        options.WithHoldLock = false;\n        options.ReturnDbGeneratedId = true;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### BulkMatch\n```c#\nvar contactsFromDb = _context.BulkMatch(matchedContacts,\n    x =\u003e new { x.CustomerId, x.CountryIsoCode },\n    options =\u003e\n    {\n        options.BatchSize = 0;\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### TempTable\n```c#\nvar customerTableName = _context.CreateTempTable(customers,\n    x =\u003e new\n    {\n        x.IdNumber,\n        x.FirstName,\n        x.LastName,\n        x.CurrentCountryIsoCode\n    },\n    options =\u003e\n    {\n        options.BatchSize = 0;\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### DirectInsert\n```c#\n_context.DirectInsert(row,\n    row =\u003e new { row.Column1, row.Column2, row.Column3 },\n    options =\u003e\n    {\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### DirectUpdate\n```c#\n_context.DirectUpdate(row,\n    row =\u003e new { row.Column3, row.Column2 },\n    options =\u003e\n    {\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n### DirectDelete\n```c#\n_context.DirectDelete(row,\n    options =\u003e\n    {\n        options.Timeout = 30;\n        options.LogTo = Console.WriteLine;\n    });\n```\n\n## Returned Result\n### BulkUpdate\n```c#\nvar updateResult = dbct.BulkUpdate(rows, row =\u003e new { row.Column3, row.Column2 });\n\nConsole.WriteLine($\"Updated: {updateResult.AffectedRows} row(s)\");\n```\n### BulkDelete\n```c#\nvar deleteResult = dbct.BulkDelete(rows);\n\nConsole.WriteLine($\"Deleted: {deleteResult.AffectedRows} row(s)\");\n```\n### BulkMerge\n```c#\nvar mergeResult = dbct.BulkMerge(rows,\n    row =\u003e row.Id,\n    row =\u003e new { row.Column1, row.Column2 },\n    row =\u003e new { row.Column1, row.Column2, row.Column3 });\n\nConsole.WriteLine($\"Updated: {mergeResult.UpdatedRows} row(s)\");\nConsole.WriteLine($\"Inserted: {mergeResult.InsertedRows} row(s)\");\nConsole.WriteLine($\"Affected: {mergeResult.AffectedRows} row(s)\");\n```\n\n## Benchmarks\n### BulkInsert\nSingle Table [/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkInsertSingleTableBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkInsertSingleTableBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|       Method | RowsCount |         Mean | Error |        Gen0 |        Gen1 |      Gen2 |     Allocated |\n|------------- |---------- |-------------:|------:|------------:|------------:|----------:|--------------:|\n| **EFCoreInsert** |       **100** |     **45.19 ms** |    **NA** |           **-** |           **-** |         **-** |     **985.52 KB** |\n|   BulkInsert |       100 |     32.68 ms |    NA |           - |           - |         - |      93.78 KB |\n| **EFCoreInsert** |      **1000** |    **145.41 ms** |    **NA** |   **1000.0000** |           **-** |         **-** |     **9702.7 KB** |\n|   BulkInsert |      1000 |     44.94 ms |    NA |           - |           - |         - |     573.84 KB |\n| **EFCoreInsert** |     **10000** |    **788.90 ms** |    **NA** |  **14000.0000** |   **5000.0000** |         **-** |   **95727.38 KB** |\n|   BulkInsert |     10000 |    126.36 ms |    NA |           - |           - |         - |    5320.53 KB |\n| **EFCoreInsert** |    **100000** |  **7,107.29 ms** |    **NA** | **146000.0000** |  **36000.0000** |         **-** |  **950162.56 KB** |\n|   BulkInsert |    100000 |    998.42 ms |    NA |   7000.0000 |   3000.0000 | 1000.0000 |   51730.81 KB |\n| **EFCoreInsert** |    **250000** | **18,542.56 ms** |    **NA** | **365000.0000** |  **87000.0000** |         **-** | **2352262.34 KB** |\n|   BulkInsert |    250000 |  2,576.88 ms |    NA |  16000.0000 |   5000.0000 | 1000.0000 |  125832.63 KB |\n| **EFCoreInsert** |    **500000** | **34,957.34 ms** |    **NA** | **730000.0000** | **170000.0000** |         **-** | **4711772.88 KB** |\n|   BulkInsert |    500000 |  5,553.61 ms |    NA |  30000.0000 |   9000.0000 | 1000.0000 |  252707.77 KB |\n\n\nMultiple Tables (1x parent rows + 5x child rows) [/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkInsertMultipleTablesBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkInsertMultipleTablesBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|       Method | RowsCount |         Mean | Error |         Gen0 |        Gen1 |      Gen2 |     Allocated |\n|------------- |---------- |-------------:|------:|-------------:|------------:|----------:|--------------:|\n| **EFCoreInsert** |       **100** |    **226.22 ms** |    **NA** |    **1000.0000** |           **-** |         **-** |    **7438.51 KB** |\n|   BulkInsert |       100 |     48.38 ms |    NA |            - |           - |         - |     444.18 KB |\n| **EFCoreInsert** |      **1000** |    **566.95 ms** |    **NA** |   **11000.0000** |   **4000.0000** |         **-** |   **73518.48 KB** |\n|   BulkInsert |      1000 |    125.77 ms |    NA |            - |           - |         - |    3460.21 KB |\n| **EFCoreInsert** |     **10000** |  **6,268.42 ms** |    **NA** |  **114000.0000** |  **30000.0000** |         **-** |  **731076.92 KB** |\n|   BulkInsert |     10000 |  1,066.74 ms |    NA |    5000.0000 |   2000.0000 | 1000.0000 |   33324.16 KB |\n| **EFCoreInsert** |    **100000** | **59,389.89 ms** |    **NA** | **1138000.0000** | **264000.0000** |         **-** | **7282561.93 KB** |\n|   BulkInsert |    100000 |  9,504.12 ms |    NA |   39000.0000 |  13000.0000 | 1000.0000 |  327100.08 KB |\n\n\n### BulkUpdate\n[/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkUpdateBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkUpdateBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|       Method | RowsCount |         Mean | Error |        Gen0 |       Gen1 |     Allocated |\n|------------- |---------- |-------------:|------:|------------:|-----------:|--------------:|\n| **EFCoreUpdate** |       **100** |     **61.65 ms** |    **NA** |           **-** |          **-** |     **853.66 KB** |\n|   BulkUpdate |       100 |     27.33 ms |    NA |           - |          - |      63.55 KB |\n| **EFCoreUpdate** |      **1000** |    **143.39 ms** |    **NA** |   **1000.0000** |          **-** |     **8398.1 KB** |\n|   BulkUpdate |      1000 |     43.95 ms |    NA |           - |          - |     379.25 KB |\n| **EFCoreUpdate** |     **10000** |    **685.97 ms** |    **NA** |  **12000.0000** |  **3000.0000** |   **82396.19 KB** |\n|   BulkUpdate |     10000 |    182.54 ms |    NA |           - |          - |    3499.74 KB |\n| **EFCoreUpdate** |    **100000** |  **8,495.18 ms** |    **NA** | **120000.0000** | **28000.0000** |  **810248.07 KB** |\n|   BulkUpdate |    100000 |  2,091.42 ms |    NA |   5000.0000 |  1000.0000 |   33819.46 KB |\n| **EFCoreUpdate** |    **250000** | **17,859.49 ms** |    **NA** | **300000.0000** | **69000.0000** | **2005895.77 KB** |\n|   BulkUpdate |    250000 |  4,290.07 ms |    NA |  13000.0000 |  7000.0000 |      84352 KB |\n\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|     Method | RowsCount |    Mean | Error |       Gen0 |       Gen1 | Allocated |\n|----------- |---------- |--------:|------:|-----------:|-----------:|----------:|\n| **BulkUpdate** |    **500000** | **10.19 s** |    **NA** | **27000.0000** | **16000.0000** | **164.63 MB** |\n| **BulkUpdate** |   **1000000** | **17.03 s** |    **NA** | **54000.0000** | **37000.0000** | **329.12 MB** |\n\n\n### BulkDelete\n[/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkDeleteBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkDeleteBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|       Method | RowsCount |         Mean | Error |       Gen0 |       Gen1 |    Allocated |\n|------------- |---------- |-------------:|------:|-----------:|-----------:|-------------:|\n| **EFCoreDelete** |       **100** |     **73.25 ms** |    **NA** |          **-** |          **-** |    **681.09 KB** |\n|   BulkDelete |       100 |     29.42 ms |    NA |          - |          - |     43.45 KB |\n| **EFCoreDelete** |      **1000** |    **176.83 ms** |    **NA** |  **1000.0000** |  **1000.0000** |      **6745 KB** |\n|   BulkDelete |      1000 |     27.19 ms |    NA |          - |          - |    236.86 KB |\n| **EFCoreDelete** |     **10000** |  **1,489.03 ms** |    **NA** | **10000.0000** |  **2000.0000** |  **66031.55 KB** |\n|   BulkDelete |     10000 |    431.74 ms |    NA |          - |          - |   2150.99 KB |\n| **EFCoreDelete** |     **20000** |  **6,084.87 ms** |    **NA** | **20000.0000** |  **7000.0000** |  **132403.3 KB** |\n|   BulkDelete |     20000 |    276.52 ms |    NA |          - |          - |   4276.01 KB |\n| **EFCoreDelete** |     **50000** | **39,933.60 ms** |    **NA** | **49000.0000** | **14000.0000** | **326164.25 KB** |\n|   BulkDelete |     50000 |  1,477.09 ms |    NA |  1000.0000 |          - |  10594.63 KB |\n\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|     Method | RowsCount |       Mean | Error |       Gen0 |       Gen1 | Allocated |\n|----------- |---------- |-----------:|------:|-----------:|-----------:|----------:|\n| **BulkDelete** |    **100000** |   **937.7 ms** |    **NA** |  **3000.0000** |  **1000.0000** |  **20.67 MB** |\n| **BulkDelete** |    **250000** | **2,619.7 ms** |    **NA** |  **7000.0000** |  **3000.0000** |   **51.7 MB** |\n| **BulkDelete** |    **500000** | **4,897.7 ms** |    **NA** | **13000.0000** |  **6000.0000** | **103.22 MB** |\n| **BulkDelete** |   **1000000** | **9,466.0 ms** |    **NA** | **26000.0000** | **12000.0000** | **206.28 MB** |\n\n\n### BulkMerge\n[/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMergeBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMergeBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|       Method | RowsCount |         Mean | Error |        Gen0 |        Gen1 |      Gen2 |     Allocated |\n|------------- |---------- |-------------:|------:|------------:|------------:|----------:|--------------:|\n| **EFCoreUpsert** |       **100** |     **82.11 ms** |    **NA** |           **-** |           **-** |         **-** |    **1840.23 KB** |\n|    BulkMerge |       100 |     34.27 ms |    NA |           - |           - |         - |     162.96 KB |\n| **EFCoreUpsert** |      **1000** |    **266.86 ms** |    **NA** |   **2000.0000** |   **1000.0000** |         **-** |   **17984.91 KB** |\n|    BulkMerge |      1000 |     79.45 ms |    NA |           - |           - |         - |    1213.33 KB |\n| **EFCoreUpsert** |     **10000** |  **1,451.20 ms** |    **NA** |  **26000.0000** |   **8000.0000** |         **-** |  **178385.15 KB** |\n|    BulkMerge |     10000 |    677.47 ms |    NA |   1000.0000 |           - |         - |   11679.42 KB |\n| **EFCoreUpsert** |    **100000** | **13,902.06 ms** |    **NA** | **266000.0000** |  **63000.0000** |         **-** | **1762696.52 KB** |\n|    BulkMerge |    100000 |  3,415.31 ms |    NA |  16000.0000 |   6000.0000 | 1000.0000 |   115233.2 KB |\n| **EFCoreUpsert** |    **250000** | **36,167.51 ms** |    **NA** | **665000.0000** | **152000.0000** |         **-** | **4362872.57 KB** |\n|    BulkMerge |    250000 |  7,681.71 ms |    NA |  37000.0000 |  11000.0000 | 1000.0000 |  284187.09 KB |\n\n\n[/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMergeReturnDbGeneratedIdBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMergeReturnDbGeneratedIdBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|                 Method | RowsCount |        Mean | Error |       Gen0 |      Gen1 |      Gen2 |    Allocated |\n|----------------------- |---------- |------------:|------:|-----------:|----------:|----------:|-------------:|\n|    **ReturnDbGeneratedId** |       **100** |    **38.45 ms** |    **NA** |          **-** |         **-** |         **-** |    **151.09 KB** |\n| NotReturnDbGeneratedId |       100 |    37.75 ms |    NA |          - |         - |         - |     116.8 KB |\n|    **ReturnDbGeneratedId** |      **1000** |    **67.42 ms** |    **NA** |          **-** |         **-** |         **-** |   **1099.48 KB** |\n| NotReturnDbGeneratedId |      1000 |    60.02 ms |    NA |          - |         - |         - |    769.23 KB |\n|    **ReturnDbGeneratedId** |     **10000** |   **783.73 ms** |    **NA** |  **1000.0000** |         **-** |         **-** |  **10543.62 KB** |\n| NotReturnDbGeneratedId |     10000 |   501.07 ms |    NA |  1000.0000 |         - |         - |   7348.79 KB |\n|    **ReturnDbGeneratedId** |    **100000** | **3,187.89 ms** |    **NA** | **14000.0000** | **5000.0000** | **1000.0000** | **103878.09 KB** |\n| NotReturnDbGeneratedId |    100000 | 2,741.31 ms |    NA | 11000.0000 | 5000.0000 | 1000.0000 |  72936.01 KB |\n\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|                 Method | RowsCount |     Mean | Error |        Gen0 |       Gen1 |      Gen2 |  Allocated |\n|----------------------- |---------- |---------:|------:|------------:|-----------:|----------:|-----------:|\n|    **ReturnDbGeneratedId** |    **250000** |  **7.799 s** |    **NA** |  **32000.0000** |  **8000.0000** |         **-** |   **249.8 MB** |\n| NotReturnDbGeneratedId |    250000 |  6.619 s |    NA |  24000.0000 |  7000.0000 |         - |   177.7 MB |\n|    **ReturnDbGeneratedId** |    **500000** | **15.051 s** |    **NA** |  **66000.0000** | **19000.0000** | **1000.0000** |  **500.64 MB** |\n| NotReturnDbGeneratedId |    500000 | 14.328 s |    NA |  47000.0000 | 14000.0000 |         - |  355.19 MB |\n|    **ReturnDbGeneratedId** |   **1000000** | **32.449 s** |    **NA** | **129000.0000** | **34000.0000** |         **-** | **1003.67 MB** |\n| NotReturnDbGeneratedId |   1000000 | 28.253 s |    NA |  95000.0000 | 28000.0000 |         - |  710.22 MB |\n\n\n### BulkMatch\nSingle Column [/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMatchSingleColumnBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMatchSingleColumnBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|            Method | RowsCount |          Mean | Error |        Gen0 |       Gen1 |      Gen2 |   Allocated |\n|------------------ |---------- |--------------:|------:|------------:|-----------:|----------:|------------:|\n|      **EFCoreSelect** |       **100** |     **97.373 ms** |    **NA** |           **-** |          **-** |         **-** |  **1008.33 KB** |\n| EFCoreBatchSelect |       100 |      7.166 ms |    NA |           - |          - |         - |    94.77 KB |\n|         BulkMatch |       100 |      8.570 ms |    NA |           - |          - |         - |   106.63 KB |\n|      **EFCoreSelect** |      **1000** |    **720.250 ms** |    **NA** |   **1000.0000** |          **-** |         **-** |  **9761.42 KB** |\n| EFCoreBatchSelect |      1000 |      6.375 ms |    NA |           - |          - |         - |   908.18 KB |\n|         BulkMatch |      1000 |     15.445 ms |    NA |           - |          - |         - |   820.36 KB |\n|      **EFCoreSelect** |     **10000** |  **8,075.686 ms** |    **NA** |  **15000.0000** |  **1000.0000** |         **-** | **97115.62 KB** |\n| EFCoreBatchSelect |     10000 |     66.438 ms |    NA |   1000.0000 |          - |         - |  9092.91 KB |\n|         BulkMatch |     10000 |     69.430 ms |    NA |   1000.0000 |          - |         - |  8177.76 KB |\n|      **EFCoreSelect** |    **100000** | **81,088.718 ms** |    **NA** | **159000.0000** | **31000.0000** | **1000.0000** | **972204.7 KB** |\n| EFCoreBatchSelect |    100000 |    920.412 ms |    NA |  11000.0000 |  4000.0000 | 1000.0000 | 91808.56 KB |\n|         BulkMatch |    100000 |    742.030 ms |    NA |  13000.0000 |  6000.0000 | 1000.0000 | 82419.43 KB |\n\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|            Method | RowsCount |     Mean | Error |        Gen0 |       Gen1 |      Gen2 | Allocated |\n|------------------ |---------- |---------:|------:|------------:|-----------:|----------:|----------:|\n| **EFCoreBatchSelect** |    **250000** |  **2.101 s** |    **NA** |  **26000.0000** | **11000.0000** | **1000.0000** | **224.05 MB** |\n|         BulkMatch |    250000 |  2.067 s |    NA |  32000.0000 | 12000.0000 | 1000.0000 | 201.64 MB |\n| **EFCoreBatchSelect** |    **500000** |  **4.239 s** |    **NA** |  **53000.0000** | **20000.0000** | **2000.0000** | **448.85 MB** |\n|         BulkMatch |    500000 |  4.507 s |    NA |  62000.0000 | 24000.0000 | 1000.0000 | 404.03 MB |\n| **EFCoreBatchSelect** |   **1000000** |  **8.523 s** |    **NA** | **103000.0000** | **38000.0000** | **1000.0000** | **898.44 MB** |\n|         BulkMatch |   1000000 | 11.585 s |    NA | 123000.0000 | 46000.0000 | 1000.0000 | 808.82 MB |\n\n\nMultiple Columns [/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMatchMultipleColumnsBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/BulkMatchMultipleColumnsBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|       Method | RowsCount |         Mean | Error |        Gen0 |       Gen1 |     Allocated |\n|------------- |---------- |-------------:|------:|------------:|-----------:|--------------:|\n| **EFCoreSelect** |       **100** |    **130.11 ms** |    **NA** |           **-** |          **-** |     **1256.8 KB** |\n|    BulkMatch |       100 |     15.46 ms |    NA |           - |          - |     173.56 KB |\n| **EFCoreSelect** |      **1000** |    **997.87 ms** |    **NA** |   **2000.0000** |          **-** |   **12373.85 KB** |\n|    BulkMatch |      1000 |     43.35 ms |    NA |           - |          - |    1358.77 KB |\n| **EFCoreSelect** |     **10000** |  **9,769.96 ms** |    **NA** |  **20000.0000** |  **4000.0000** |  **123595.97 KB** |\n|    BulkMatch |     10000 |    238.80 ms |    NA |   2000.0000 |  1000.0000 |   13768.49 KB |\n| **EFCoreSelect** |    **100000** | **89,204.16 ms** |    **NA** | **201000.0000** | **51000.0000** | **1237424.23 KB** |\n|    BulkMatch |    100000 |  2,612.00 ms |    NA |  21000.0000 |  8000.0000 |  138686.52 KB |\n\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|    Method | RowsCount |     Mean | Error |        Gen0 |       Gen1 |  Allocated |\n|---------- |---------- |---------:|------:|------------:|-----------:|-----------:|\n| **BulkMatch** |    **250000** |  **6.709 s** |    **NA** |  **53000.0000** | **19000.0000** |  **340.68 MB** |\n| **BulkMatch** |    **500000** | **12.939 s** |    **NA** | **107000.0000** | **36000.0000** |  **683.46 MB** |\n| **BulkMatch** |   **1000000** | **25.418 s** |    **NA** | **214000.0000** | **74000.0000** | **1369.34 MB** |\n\n\n### TempTable\n[/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/TempTableBenchmarks.cs](/src/EntityFrameworkCore.SqlServer.SimpleBulks.Benchmarks/TempTableBenchmarks.cs)\n\n``` ini\n\nBenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.5011)\n11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores\n.NET SDK=8.0.400\n  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n  Job-LGAVYD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2\n\nInvocationCount=1  IterationCount=1  UnrollFactor=1  \nWarmupCount=0  \n\n```\n|          Method | RowsCount |         Mean | Error |       Gen0 |       Gen1 |      Gen2 |    Allocated |\n|---------------- |---------- |-------------:|------:|-----------:|-----------:|----------:|-------------:|\n| **CreateTempTable** |       **100** |     **7.639 ms** |    **NA** |          **-** |          **-** |         **-** |     **68.03 KB** |\n| **CreateTempTable** |      **1000** |    **14.077 ms** |    **NA** |          **-** |          **-** |         **-** |    **373.76 KB** |\n| **CreateTempTable** |     **10000** |    **89.789 ms** |    **NA** |          **-** |          **-** |         **-** |   **3455.46 KB** |\n| **CreateTempTable** |    **100000** |   **574.937 ms** |    **NA** |  **4000.0000** |  **1000.0000** |         **-** |  **34081.95 KB** |\n| **CreateTempTable** |    **250000** | **1,403.071 ms** |    **NA** | **12000.0000** |  **5000.0000** | **1000.0000** |  **85229.91 KB** |\n| **CreateTempTable** |    **500000** | **2,838.562 ms** |    **NA** | **22000.0000** |  **8000.0000** | **1000.0000** | **170241.85 KB** |\n| **CreateTempTable** |   **1000000** | **6,198.206 ms** |    **NA** | **43000.0000** | **14000.0000** | **1000.0000** |  **340282.7 KB** |\n\n\n## License\n**EntityFrameworkCore.SqlServer.SimpleBulks** is licensed under the [MIT](/LICENSE) license.\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","ORM","Audio"],"sub_categories":["ORM","GUI - other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphongnguyend%2FEntityFrameworkCore.SqlServer.SimpleBulks/lists"}