Hi,
I’m just looking at the SimpleQueuedHandler class whilst trying to implement a feature. I’m interested to know why linq is not being used when checking the queue length, instead of count !=0? Would this impact performance?
Also, How do I go about getting some commercial consultancy?
Help appreciated as always.
Kind regards
Sean.
Hi Greg,
I'm referring to line 45.
Cheers
Sean.
No, Count will still iterate through every element, the Linq namespace is not referenced at all in that file.
There is a difference between Count() the method on IEnumerable
https://msdn.microsoft.com/en-us/library/bb338038(v=vs.100).aspx and
Count the property on ConcurrentQueue
https://msdn.microsoft.com/en-us/library/dd267339(v=vs.110).aspx.
Note its using .Count not .Count()
True, even so, shouldn't it then be using IsEmpty? .Count seems overkill?
Feel free to measure, If this is a bottleneck on an IO bound operation
I would be amazed.