-
Notifications
You must be signed in to change notification settings - Fork 523
Conversation
+1 - Reference for the curious: http://blogs.msdn.com/b/pfxteam/archive/2010/04/26/9997562.aspx |
ConcurrentBag might work here; it operates in an almost uncontended way, but its a memory pig and allocates lots of small objects; so would probably be bad in the GC stakes :( |
/cc @stephentoub |
As an aside we switched from |
Isn't it better to provide the most-recently-returned block, rather than provide the least-recently-used block, when someone asks for memory? That's why it was a stack instead of a queue in the first place |
The issue is caused by contention by both readers and writers on the With Also |
Though something to measure (perhaps after the other changes to up throughput) @NickCraver saw an increase from 931,289 RPS to 1,191,674 RPS when this was added on top of the other changes. |
If contention on the memory pool is having this much of an impact on perf, it might be worth investigating if round-robin distributing to separate pools is an improvement. |
@rynowak I push them out so each |
Okay, reducing push/pull contention sounds like a reasonable cause for the change. Doesn't each thread already have it's own pool2? |
Well - each uv loop more than each thread. The fact that some of the work is done on worker threads means the pool isn't truly isolated to the loop |
PRs not been merged yet ;-) |
ConcurrentStack -> ConcurrentQueue
Stack to Queue test by @NickCraver https://twitter.com/Nick_Craver/status/665503509958258688