Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.
Miňo Martiniak edited this page May 1, 2018 · 15 revisions

Bulk operation performance

KORM support bulk operations BulkInsert and BulkUpdate. Thanks to this, it can handle a lot of data very quickly.

Microsoft SQL Server

Operation 1 000 Entities 5 000 Entities 10 000 Entities 20 000 Entities
Pure Ado.Net inserts ??? ms ??? ms ??? ms ??? ms
BulkInsert with KORM ??? ms ??? ms ??? ms ??? ms
Pure Ado.Net update ??? ms ??? ms ??? ms ??? ms
BulkUpdate with KORM ??? ms ??? ms ??? ms ??? ms

Microsoft Access

Operation 1 000 Entities 5 000 Entities 10 000 Entities 20 000 Entities
Pure Ado.Net inserts 854 ms 4 113 ms 8 241 ms 15 874 ms
BulkInsert with KORM 418 ms 480 ms 684 ms 1 105 ms
Pure Ado.Net update ??? ms ??? ms ??? ms ??? ms
BulkUpdate with KORM ??? ms ??? ms ??? ms ??? ms

This is not an official benchmark. The data contains 23 columns. It was tested on Intel Core i7 vPro, 16 GB RAM and SSD. But for comparison it is sufficient.

Example

BulkInsert

using (var database = new Database("connectionstring ...", "ado client name ..."))
{
    database
       .Query<Movie>()
       .AsDbSet()
       .BulkInsert(_data);
}

BulkUpdate

using (var database = new Database("connectionstring ...", "ado client name ..."))
{
    database
        .Query<Movie>()
        .AsDbSet()
        .BulkUpdate(_data);
}
Clone this wiki locally