-
-
Notifications
You must be signed in to change notification settings - Fork 226
Severe lock contention in BlockingCollection in BinLogReader #684
Copy link
Copy link
Closed
Description
The BlockingCollection in BinLogReader suffers from severe lock contention:
| // Use a producer-consumer queue so that IO can happen on one thread | |
| // while processing can happen on another thread decoupled. The speed | |
| // up is from 4.65 to 4.15 seconds. | |
| var queue = new BlockingCollection<BuildEventArgs>(boundedCapacity: 5000); |
I added some debug code, and the initial results were:
Read 24924 records in 00:00:06.8023352 = 6802.3352 ms
raising the bounded capacity from 5000 to 50000, I get:
Read 24924 records in 00:00:00.3312354 = 331.2354 ms
which means that >95% of the time spent loading the binlog is spent waiting for a lock.
This is on macOS with the Avalonia version, but I'm guessing something similar would happen elsewhere as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels