Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exponential slowdown on parallel executions #33

Open
Hugibeer opened this issue Apr 29, 2020 · 5 comments
Open

Exponential slowdown on parallel executions #33

Hugibeer opened this issue Apr 29, 2020 · 5 comments

Comments

@Hugibeer
Copy link

Hello.

We are using this library for bulk insert operations in our .NET 4.7 application. We noticed that, when multiple users. So, I typed out a little application which inserts million of entries in a chunks of 4000 items, you can find it in this repo https://github.com/Hugibeer/TannerydSample
I was shocked to see how slow it is when executing bulk insert operation on multiple threads, in https://github.com/Hugibeer/TannerydSample/tree/master/Measurements you can see that, when executing this operaiton in 10 threads, execution per thread is slowed down to 235 seconds, or so. It seems there is something seriously throttling these operations.

I ran 1000 iterations on SQLBulkCopy and SQL procedur inserts, measurements with rudimentary analysis can be read here https://github.com/Hugibeer/TannerydSample/tree/master/AutomatedMeasurements
I am currently running 10 iterations of only ef6 bulk operations and will add those files to the AutomatedMeasurements folder in the repo.

Just to make things clear, this isn't "hate post", I only want to raise an attention to you to these details.

Thank you

@Hugibeer
Copy link
Author

For comparison, on test PC I am using, SQLBulkCopy and SQL procedure, on 10 thread parallel executions have average of around 30 seconds, while ef6 bulk operations is at 113 seconds

@mtanneryd
Copy link
Owner

mtanneryd commented Apr 29, 2020 via email

@Hugibeer
Copy link
Author

If you need any input from me, please let me know.
Thank you

@Hugibeer
Copy link
Author

Hugibeer commented May 4, 2020

It is cleare to me why the library is slower than SqlBulkCopy and SQL procedure approaches, it does two DB orundtrips, one to insert in temp table, the other to insert into real table and hydrate database generated IDs.
I am using slightly older version of library in the repository, I tried updating it, but still got the same performances from it.

@mtanneryd
Copy link
Owner

mtanneryd commented May 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants