Is SqlBulkCopy even faster than Dapper?

I found an article by Sam Shaffron about mass pasting with Dapper ( This nasty pasting problem getting data in db using dapper ), where he ends the article with the statement:

For example, if you need an ultra-fast way to insert a large amount of material into SQL DB, nothing will beat SqlBulkCopy, and for this you need a special API.

The article is more than 4 years old.

I recently stumbled upon Dapper Plus , which claims to be capable of doing 1,000,000 rows in 2,000 ms, which seems to be superior to SqlBulkCopy in many of the old performance articles I found (like this one - ORM Score for Batch Data ).

My Google-fu, unfortunately, could not find later performance comparisons between the two bulk import methods.

Question: Is SqlBulkCopy even faster than Dapper.NET ?

+6
source share
1 answer

Disclaimer : I am the owner of the Dapper Plus project

Dapper Plus for SQL Server / Azure uses SqlBulkCopy under the hood when there are enough entities to store, otherwise it will use a SQL view.

In this article, we will talk about the Entity Framework, but this is the same strategy for Dapper if you want to get more information: Entity Framework How to populate a nested SQL Server

Thus, our library, obviously, does not exceed SqlBulkCopy, it has the same performance, but our library simplifies its use.

The library also supports:

  • Bulkupdate
  • Bulkdelete
  • Bulkmerge

using the SqlBulkCopy and Temporary Table tricks.

+5
source

All Articles